From d7d6d78b5437b77e7f8526d6e48a35293603d138 Mon Sep 17 00:00:00 2001 From: Krrish Mittal Date: Fri, 30 Jan 2026 18:11:23 -0800 Subject: [PATCH] fix(data-mapper-v2): resolve XML attribute paths when loading saved maps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../src/mapHandling/MapDefinitionDeserializer.ts | 5 +++-- .../mapHandling/__test__/MapDefinitionDeserializer.spec.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/data-mapper-v2/src/mapHandling/MapDefinitionDeserializer.ts b/libs/data-mapper-v2/src/mapHandling/MapDefinitionDeserializer.ts index b3b8fa7e488..c42061685b6 100644 --- a/libs/data-mapper-v2/src/mapHandling/MapDefinitionDeserializer.ts +++ b/libs/data-mapper-v2/src/mapHandling/MapDefinitionDeserializer.ts @@ -148,8 +148,9 @@ export class MapDefinitionDeserializer { srcNode = this.getSourceNodeWithBackout(key); } else { const lastLoop = this.getLowestLoop().key; - // danielle handle namespace here - srcNode = findNodeForKey(`${lastLoop}/${key}`, this._sourceSchema.schemaTreeRoot, false) as SchemaNodeExtended; + // Handle relative attribute paths like './@AttributeName' by stripping the './' prefix + const normalizedKey = key.startsWith('./@') ? key.substring(2) : key; + srcNode = findNodeForKey(`${lastLoop}/${normalizedKey}`, this._sourceSchema.schemaTreeRoot, false) as SchemaNodeExtended; } return srcNode; }; diff --git a/libs/data-mapper-v2/src/mapHandling/__test__/MapDefinitionDeserializer.spec.ts b/libs/data-mapper-v2/src/mapHandling/__test__/MapDefinitionDeserializer.spec.ts index 25b9597ad89..0139038bc10 100644 --- a/libs/data-mapper-v2/src/mapHandling/__test__/MapDefinitionDeserializer.spec.ts +++ b/libs/data-mapper-v2/src/mapHandling/__test__/MapDefinitionDeserializer.spec.ts @@ -1224,7 +1224,7 @@ describe('mapDefinitions/MapDefinitionDeserializer', () => { ); }); - it.skip('creates a looping connection w/ index variable, conditional, and relative attribute path', () => { + it('creates a looping connection w/ index variable, conditional, and relative attribute path', () => { simpleMap['ns0:Root'] = { LoopingWithIndex: { WeatherSummary: {