Hi,
I'm quite new to XSLT thus I do not know yet whether what I want to do is possible or not.
I have an XML file (see sample below) that is split into two main parts
- a set of nodes (called form) that may contain a set of items.
- a set of form_ref nodes that describe a structure. The liknk between the structure and the forms node is made by the refname attribute that match a form name attribute.
What I want to do is to produce a result xml file that presents my form nodes in the same order as the structure.
Here's an exmple of the source XML:
<template>
<structure>
<form_ref refname="A"/>
<form_ref refname="B">
<form_ref refname="B1"/>
<form_ref refname="B2"/>
</form_ref>
</structure>
<form name="B"></form>
<form name="B2">
<item item_name="itemname05" value="aaaa" />
<item item_name="itemname06" value="bbbb" />
</form>
<form name="B1">
<item item_name="itemname04" value="yyyy" />
</form>
<form name="A">
<item item_name="itemname01" value="zzz" />
<item item_name="itemname02" value="qqq" />
<item item_name="itemname03" value="ooo" />
</form>
</template>
Thanks for any idea on how to do that in XSLT.
I'm quite new to XSLT thus I do not know yet whether what I want to do is possible or not.
I have an XML file (see sample below) that is split into two main parts
- a set of nodes (called form) that may contain a set of items.
- a set of form_ref nodes that describe a structure. The liknk between the structure and the forms node is made by the refname attribute that match a form name attribute.
What I want to do is to produce a result xml file that presents my form nodes in the same order as the structure.
Here's an exmple of the source XML:
<template>
<structure>
<form_ref refname="A"/>
<form_ref refname="B">
<form_ref refname="B1"/>
<form_ref refname="B2"/>
</form_ref>
</structure>
<form name="B"></form>
<form name="B2">
<item item_name="itemname05" value="aaaa" />
<item item_name="itemname06" value="bbbb" />
</form>
<form name="B1">
<item item_name="itemname04" value="yyyy" />
</form>
<form name="A">
<item item_name="itemname01" value="zzz" />
<item item_name="itemname02" value="qqq" />
<item item_name="itemname03" value="ooo" />
</form>
</template>
Thanks for any idea on how to do that in XSLT.