Using XSLT To Combine Data from Parallel Nodes
Posted: Wed Mar 27, 2019 1:08 am
Is it possible to take a value from one node in xml, attributes always in this particular xml, and find that value in a key pair, id=2 for example, and take information from the node with id=2 and combine it with information from the original node. All with the objective to make it easier to read in an xml reader, to better decipher the data.
So, to clear that up here is a simple example:
<xml ...>
<MyNode1>
<Brick ID = "2", Color = "red", Material = "Clay">
<SomeOtherTag attribute1="build"/>
</Brick>
<Brick ID = "3", Color = "black", Material = "Clay">
<SomeOtherTag attribute1="build"/>
</Brick>
</MyNode1>
<PartsOfHouse>
<House ID="1", Brick="2", Yada="3", Yada2="big" />
<House ID="2", Brick="3", Yada="3", Yada2="big" />
</PartsOfHouse>
Run through XSLT ....
<PartsOfHouse>
<House ID="1", Brick="2", Color = "red", Yada="3", Yada2="big" />
<House ID="2", Brick="3", Color = "black", Yada="3", Yada2="big" />
</PartsOfHouse>
So, to clear that up here is a simple example:
<xml ...>
<MyNode1>
<Brick ID = "2", Color = "red", Material = "Clay">
<SomeOtherTag attribute1="build"/>
</Brick>
<Brick ID = "3", Color = "black", Material = "Clay">
<SomeOtherTag attribute1="build"/>
</Brick>
</MyNode1>
<PartsOfHouse>
<House ID="1", Brick="2", Yada="3", Yada2="big" />
<House ID="2", Brick="3", Yada="3", Yada2="big" />
</PartsOfHouse>
Run through XSLT ....
<PartsOfHouse>
<House ID="1", Brick="2", Color = "red", Yada="3", Yada2="big" />
<House ID="2", Brick="3", Color = "black", Yada="3", Yada2="big" />
</PartsOfHouse>