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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Nested variable compile error ... (5)
-> - Replace a nodeset with another... (2)
-> ->Replace a nodeset with an...
-> + StackOverFlow Error, while com... (4)
-> + Footnote - WORDML (6)
-> + Concatenate same input element... (3)
-> + Need to remove the sub element... (3)
-> + Grabbing sub-namespace values (2)
-> + Converting date via browser XS... (4)
-> + Selecting Attribute nodes (2)
-> + XSLT totaling numeric values (4)
-> + Two line output by breaking on... (3)
-> + Encoding Option for base64Bina... (2)
-> + using document and web service... (2)
-> + XSLT transformations with JDK1... (8)
-> - Parsing Excel XML - Selectiing... (1)
-> + Grouping this xml input very n... (2)
-> + XSL-FO page-sequence and blank... (2)
-> + Need Help In XSLT Mapping (3)
-> + how to create the Tables by co... (2)
-> + fo:external-graphic - Image ... (2)
-- Previous [481-500] [501-520] [521-540] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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.

   
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.