Closed breiko83 closed 3 years ago
I need to use importDocument twice and I'm having issues going up 1 node after importing is called.
This is the expected xml:
<workout> <tags> <tag name="tag1" /> <tag name="tag2" /> </tags> <people> <person name="mike"> </people> </workout>
This is what i get:
<workout> <tags> <tag name="tag1" /> <tag name="tag2" /> <person name="mike"> </tags> <people /> </workout>
This is my code:
let xml = Builder.begin().ele('workout').ele('tags') tags.map((tag) => { t = Builder.create('tag').att('name',tag) xml.importDocument(t) }) xml.up().ele('people') people.map((name) => { t = Builder.create('person').att('name',name) xml.importDocument(t) })
This line:
xml.up().ele('people')
should be:
xml = xml.up().ele('people')
Thank you!!
I need to use importDocument twice and I'm having issues going up 1 node after importing is called.
This is the expected xml:
This is what i get:
This is my code: