Hi XSL Gurus,
I need to flatten an XML hierarchy that can go many levels deep, to an XML doc that's only 1 level deep. In the flattened form, though, it must be able to reference what it's parent node used to be.
Here's an example:
to this:
I've been looking around all day, and I can't find any leads. Can anyone point me in the right direction?
Thanks,
Mike
I need to flatten an XML hierarchy that can go many levels deep, to an XML doc that's only 1 level deep. In the flattened form, though, it must be able to reference what it's parent node used to be.
Here's an example:
Code:
<PACKAGE id = "1">
<OPTION_CLASS id = "2">
<OPTION_CLASS id = "3">
<PART id = "4"/>
<OPTION_CLASS id = "5">
<PART id = "6"/>
</OPTION_CLASS>
</OPTION_CLASS>
<PART id = "7"/>
</OPTION_CLASS>
<OPTION_CLASS id = "8">
<PART id = "9"/>
</OPTION_CLASS>
<PART id = "10"/>
<PART id = "11"/>
</PACKAGE>
to this:
Code:
<PACKAGE id = "1">
<OPTION_CLASS id = "2" parent_id = "1">
<PART id = "7"/>
</OPTION_CLASS>
<OPTION_CLASS id = "3" parent_id = "2">
<PART id = "4"/>
</OPTION_CLASS>
<OPTION_CLASS id = "5" parent_id = "3">
<PART id = "6"/>
</OPTION_CLASS>
<OPTION_CLASS id = "8" parent_id = "1">
<PART id = "9"/>
</OPTION_CLASS>
<PART id = "10"/>
<PART id = "11"/>
</PACKAGE>
I've been looking around all day, and I can't find any leads. Can anyone point me in the right direction?
Thanks,
Mike