Hi!
I'm new to the forum and to xslt.
My problem is that I have to transform a cloud-like data hierarchy xml into a tree-like data hierarchy xml. Let me give you some example:
input xml:
<DATA>
<OBJECT id="1" class="CAR">
<ATTRIBUTE name="name" value="CITROEN CX" />
<ATTRIBUTE name="content" value="photo_link" />
</OBJECT>
<OBJECT id="2" class="SPARE_PARTS">
<ATTRIBUTE name="name" value="REAR_LEFT_WING" />
<ATTRIBUTE name="content" value="photo_link" />
</OBJECT>
<OBJECT id="3" class="CAR">
<ATTRIBUTE name="name" value="Peugeot 206" />
<ATTRIBUTE name="content" value="photo_link" />
</OBJECT>
<OBJECT id="4" class="SPARE_PARTS">
<ATTRIBUTE name="name" value="SPARK_PLUG" />
<ATTRIBUTE name="content" value="photo_link" />
</OBJECT>
</DATA>
<LINKS>
<LINK from="1" to="2" />
<LINK from="3" to="4" />
</LINKS>
the example output is:
<TreeNode id="1" class="CAR" name="Citroen CX">
<TreeNode id="2" class="SPARE_PARTS" name="REAR_LEFT_WING"/>
</TreeNode>
<TreeNode id="3" class="CAR" name="Peugeot 206">
<TreeNode id="4" class="SPARE_PARTS" name="SPARK_PLUG"/>
</TreeNode>
the question is:
is it realizable by means of XSLT?
If so, is it worth doing this way?
And finally, any clue where to start from ? :)
Thanks for your help in advance!