<main>
<parent>
<parentId>parentId1</parentId>
<aParentField>aParentValue
</aParentField>
</parent>
<child>
<parentId>parentId1</parentId>
<aChildField>aChildValue
</aChildField>
</child>
</main>
I am new to XML and was trying to combine A and B using the ID as a parameter to combine, so the result should be like:
<main>
<parent>
<parentId>parentId1</parentId>
<aParentField>aParentValue
</aParentField>
<child>
<aChildField>aChildValue
</aChildField>
</child>
</parent>
</main>
What can be used and how ?
The example is a little ambiguous. Assuming your input can have multiple
parent
nodes, each linked to multiplechild
nodes, I would suggest you use a key to resolve the cross-references:XSLT 1.0