Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Build Hierarchy with XSLT

Status
Not open for further replies.

chriswallis

Programmer
Feb 22, 2002
9
GB
Can anyone tell me how to create the Destination document from the Source document listed below with XSLT? I have tried all kinds of combinations of variables and multi passes throught he document but cannot get it to work. Essentially I am trying to build a hierarchical document from a denormalized document.

Source:
<?xml version=&quot;1.0&quot;?>
<xml>
<row Group='Group1' Form='Tablet' Strength='25Mg'/>
<row Group='Group1' Form='Tablet' Strength='50Mg'/>
<row Group='Group2' Form='Rotadisk' Strength='125Mg'/>
<row Group='Group2' Form='Rotadisk' Strength='250Mg'/>
<row Group='Group2' Form='Device' Strength='125Mg'/>
</xml>

Destination:
<?xml version=&quot;1.0&quot;?>
<xml>
<Group>
<Description>Group1</Description>
<Form>
<Description>Tablet</Description>
<Strength>
<Description>25Mg</Description>
</Strength>
<Strength>
<Description>50Mg</Description>
</Strength>
</Form>
</Group>
<Group>
<Description>Group2</Description>
<Form>
<Description>Rotadisk</Description>
<Strength>
<Description>125Mg</Description>
</Strength>
<Strength>
<Description>250Mg</Description>
</Strength>
</Form>
<Form>
<Description>Device</Description>
<Strength>
<Description>125Mg</Description>
</Strength>
</Form>
</Group>
</xml>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top