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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting an element and all of its parents

Status
Not open for further replies.

jimmybambino

Programmer
Jun 4, 2003
5
US
I need to be able to use xslt to transform this:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>

<FormTree>
<Node Description=&quot;Ohio&quot; OrderId=&quot;10000&quot;>
<Node Description=&quot;Southwest Counties&quot; OrderId=&quot;20000&quot;>
<Node Description=&quot;Butler&quot; OrderId=&quot;50000&quot;>
<Node Description=&quot;Decedent&apos;s Estate&quot; OrderId=&quot;71500&quot;>
<GroupNode Description=&quot;Part 1&quot; OrderId=&quot;1000&quot;>
<FormNode Description=&quot;1.0 - (Front) Surviving Spouse, Children, Next of Kin, Legatees and Devisees &quot; OrderId=&quot;100&quot; Category=&quot;standardestate&quot; Code=&quot;1009&quot; />
<FormNode Description=&quot;1.0 - (Back) Surviving Spouse, Children, Next of Kin, Legatees and Devisees&quot; OrderId=&quot;200&quot; Category=&quot;standardestate&quot; Code=&quot;215&quot; />
<FormNode Description=&quot;1.0 - (Prior) (Front) Surviving Spouse, Children, Next of Kin, Legatees and Devisees &quot; OrderId=&quot;250&quot; Category=&quot;standardestate&quot; Code=&quot;109&quot; />
</GroupNode>


</Node>
</Node>
</Node>
</FormTree>

in to this:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!-- Butler Estate Created By James Hunt -->

<FormTree>
<Node Description=&quot;Ohio&quot; OrderId=&quot;10000&quot;>
<Node Description=&quot;Southwest Counties&quot; OrderId=&quot;20000&quot;>
<Node Description=&quot;Butler&quot; OrderId=&quot;50000&quot;>
<Node Description=&quot;Decedent&apos;s Estate&quot; OrderId=&quot;71500&quot;>
<GroupNode Description=&quot;Part 1&quot; OrderId=&quot;1000&quot;>
<FormNode Description=&quot;1.0 - (Front) Surviving Spouse, Children, Next of Kin, Legatees and Devisees &quot; OrderId=&quot;100&quot; Category=&quot;standardestate&quot; Code=&quot;1009&quot; />
</GroupNode>


</Node>
</Node>
</Node>
</FormTree>

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>

<FormTree>
<Node Description=&quot;Ohio&quot; OrderId=&quot;10000&quot;>
<Node Description=&quot;Southwest Counties&quot; OrderId=&quot;20000&quot;>
<Node Description=&quot;Butler&quot; OrderId=&quot;50000&quot;>
<Node Description=&quot;Decedent&apos;s Estate&quot; OrderId=&quot;71500&quot;>
<GroupNode Description=&quot;Part 1&quot; OrderId=&quot;1000&quot;>
<FormNode Description=&quot;1.0 - (Back) Surviving Spouse, Children, Next of Kin, Legatees and Devisees&quot; OrderId=&quot;200&quot; Category=&quot;standardestate&quot; Code=&quot;215&quot; />
</GroupNode>


</Node>
</Node>
</Node>
</FormTree>


<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>

<FormTree>
<Node Description=&quot;Ohio&quot; OrderId=&quot;10000&quot;>
<Node Description=&quot;Southwest Counties&quot; OrderId=&quot;20000&quot;>
<Node Description=&quot;Butler&quot; OrderId=&quot;50000&quot;>
<Node Description=&quot;Decedent&apos;s Estate&quot; OrderId=&quot;71500&quot;>
<GroupNode Description=&quot;Part 1&quot; OrderId=&quot;1000&quot;>
<FormNode Description=&quot;1.0 - (Prior) (Front) Surviving Spouse, Children, Next of Kin, Legatees and Devisees &quot; OrderId=&quot;250&quot; Category=&quot;standardestate&quot; Code=&quot;109&quot; />
</GroupNode>


</Node>
</Node>
</Node>
</FormTree>


This results also need to be put into separate files. Thanks for you help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top