Skip to content

Commit a5209a0

Browse files
committed
fix(data-mapper-v2): Convert HTMLCollection to array for TypeScript iteration
1 parent 817e0f9 commit a5209a0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ export class XsltParser {
101101
}
102102

103103
// Find the main template
104-
const templates = this.doc.getElementsByTagNameNS('http://www.w3.org/1999/XSL/Transform', 'template');
105-
if (templates.length === 0) {
104+
const templatesCollection = this.doc.getElementsByTagNameNS('http://www.w3.org/1999/XSL/Transform', 'template');
105+
if (templatesCollection.length === 0) {
106106
return { success: false, error: 'No xsl:template found in XSLT', mappings: [] };
107107
}
108108

109+
// Convert HTMLCollection to array for iteration
110+
const templates = Array.from(templatesCollection);
111+
109112
const mappings: ParsedMapping[] = [];
110113
let targetRoot: string | undefined;
111114

0 commit comments

Comments
 (0)