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)
-> + How to achieve UTF-8 encoding ... (2)
-> + sorting Using JavaScript (6)
-> + Display values from .xml horiz... (5)
-> + query on xslt for-each (3)
-> + query on xslt for-each (2)
-> + issue for First occurance (2)
-> + XSL: Mapping 2 XSD to 1 XSD (2)
-> + xslt mapper looses linkage fro... (2)
-> - How to Modify only few nodes a... (1)
-> + XSLT autocomplete function (2)
-> + i need to display dynamic list... (2)
-> + How to group when source has m... (11)
-> - Using EXCEL to create XSLT for... (1)
-> + Mapper generating XSLT, popula... (2)
-> + multiple columns (2)
-> + First time to Stylus Studio 20... (3)
-> + xsl:if test statement result t... (4)
-> + XSLT for dynamic target fields (4)
-> + Remove duplicates (2)
-> + XML-XSL grouping issue while d... (2)
-- Previous [61-80] [81-100] [101-120] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Posttop
xsl guySubject: select other node based on one node in certain order
Author: xsl guy
Date: 03 May 2011 02:39 PM
Originally Posted: 03 May 2011 01:39 PM
Hi :

I need help in XSL transformation ,following is my input structure :

<command>abc</command>
<Pset name="X_number">
<var name="Y_name">A</var>
<var name="Y_num">6</var>
<var name="Z_name">C</var>
</Pset>
<Pset name="T_num">
<var name="T_num">1</var>
</Pset>
<Pset name="T_num">
<var name="T_num">2</var>
</Pset>
<Pset name="T_status">
<var name="T_status">U</var>
</Pset>
<Pset name="T_status">
<var name="T_status">V</var>
</Pset>
<Pset name="end_matching">
</Pset>

<Pset name="X_number">


I want to create following structure out of it :
<Event >

<Tnum>1</Tnum> (here TNum corresponds to first Pset of T_Num and get the value from <var name="T_num">1</var>)

<Tstatus>U</Tstatus> (here Tstatus corresponds to first Pset of T_status and get the value from <var name="T_Status">U</var>)

<Tnum>2</Tnum> ( Here also it is second one , and there can be multiple )
<Tstatus>V</Tstatus>

<Event>

I am not sure how to match Pset of T_num with corrosponding T_status ( there order should match , first Pset of T_num should match with first Pset of T_status)
Also this is single snippet example , there are multiple snippets similar like this so when we we select node we have to select all the T_num and T_status after X_number and before start of another X_number.

Any help/pointers will be appreciated.

Thanks

   
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.