Skip to content

Commit 3a74489

Browse files
takyyonclaude
andauthored
fix(data-mapper-v2): resolve XML attribute paths when loading saved maps (#8770)
When deserializing data maps containing XML attribute bindings within loops, the relative attribute path format './@AttributeName' was not being properly resolved back to the full schema node key. This caused "Source schema node not found" errors when reloading saved maps. The fix normalizes './@' prefixed paths by stripping the './' before constructing the full schema path lookup. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0ccc701 commit 3a74489

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libs/data-mapper-v2/src/mapHandling/MapDefinitionDeserializer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ export class MapDefinitionDeserializer {
148148
srcNode = this.getSourceNodeWithBackout(key);
149149
} else {
150150
const lastLoop = this.getLowestLoop().key;
151-
// danielle handle namespace here
152-
srcNode = findNodeForKey(`${lastLoop}/${key}`, this._sourceSchema.schemaTreeRoot, false) as SchemaNodeExtended;
151+
// Handle relative attribute paths like './@AttributeName' by stripping the './' prefix
152+
const normalizedKey = key.startsWith('./@') ? key.substring(2) : key;
153+
srcNode = findNodeForKey(`${lastLoop}/${normalizedKey}`, this._sourceSchema.schemaTreeRoot, false) as SchemaNodeExtended;
153154
}
154155
return srcNode;
155156
};

libs/data-mapper-v2/src/mapHandling/__test__/MapDefinitionDeserializer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ describe('mapDefinitions/MapDefinitionDeserializer', () => {
12241224
);
12251225
});
12261226

1227-
it.skip('creates a looping connection w/ index variable, conditional, and relative attribute path', () => {
1227+
it('creates a looping connection w/ index variable, conditional, and relative attribute path', () => {
12281228
simpleMap['ns0:Root'] = {
12291229
LoopingWithIndex: {
12301230
WeatherSummary: {

0 commit comments

Comments
 (0)