XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Martin WildSubject: Replace a nodeset with another similar nodeset
Author: Martin Wild
Date: 10 Nov 2008 05:44 AM
Hi,

I am fairly new to XSL. I have been given some XML and I need to make the xml hierarchical. Logically this seems fairly simple as to make it hierarchical is just a case of matching ids, but I have tried numerous methods to get the structure I need to no avail. I am now putting my ineptitude down to my inexperience.

<PW xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<w id="24" name="I">
<success>
<w id="29" name="A"/>
</success>
<failure xsi:nil="true" />
</w>
<w id="29" name="A">
<success>
<w id="32" name="M"/>
</success>
<failure>
<w id="39" name="E"/>
<w id="38" name="AE"/>
</failure>
</w>
<w id="32" name="M">
<success>
<w id="33" name="ME"/>
<w id="36" name="CE"/>
</success>
<failure>
<w id="34" name="ME"/>
<w id="35" name="T"/>
</failure>
</w>
</PW>

This is just a snippet as the xml i need to convert carries on, but the above should give an indcation of what i require.
I need the node 'A' id 29 under the success node, below 'I' to be replaced by the 'A' node, the sibling of 'I'. This occurs throughout the document.
I am thinking this needs to be recursive but I am not entirely sure how to achieve this.

Thank you in advance
Martin

Posttop
Tony LavinioSubject: Replace a nodeset with another similar nodeset
Author: Tony Lavinio
Date: 10 Nov 2008 09:56 AM
General XSLT questions are best asked on the xsl-list run by
Mulberry Technologies.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.