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)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
siba sankar nayakSubject: need help on xsl looping
Author: siba sankar nayak
Date: 20 Nov 2009 02:28 AM
I need to tranform an xml to tsv but I am facing some problem with looping.
<Test.xml>
<Tag1>
<Tag2>
<subtag1>
<subtag2 F=1 Yr=2007/>
<subtag2 F=2 Yr=2008/>
<subtag2 F=3 Yr=2009/>
<subtag2 F=4 Yr=2007/>
<subtag2 F=5 Yr=2008/>
<subtag2 F=6 Yr=2009/>
<subtag2 F=7 Yr=2007/>
<subtag2 F=8 Yr=2008/>
<subtag2 F=9 Yr=2009/>
<subtag2 F=10 Yr=2007/>
<subtag2 F=11 Yr=2008/>
<subtag2 F=12 Yr=2009/>
</subtag1>
</Tag2>
<Tag3>
<stag1>
<V F=1 >ABC</V>
<V F=2 >DEF</V>
<V F=3 >123</V>
</stag1>
<stag2>
<V F=1 >ssss</V>
<V F=2 >DDD</V>
<V F=3 >121</V>
</stag2
</Tag3>
<Tag3>
<stag1>
<V F=4 >A1B2C3</V>
<V F=5 >D2E3F5</V>
<V F=6 >243</V>
</stag1>
<stag2>
<V F=4 >s3ds</V>
<V F=5 >DsDD</V>
<V F=6 >141</V>
</stag2
</Tag3>
<Tag3>
<stag1>
<V F=7 >AABC</V>
<V F=8 >DDEF</V>
</stag1>
<stag2>
<V F=7 >sTUV</V>
<V F=8 >DSDS</V>
</stag2
</Tag3>
<Tag3>
<stag1>
<V F= 11>XYZ</V>
<V F=12 >999</V>
</stag1>
<stag2>
<V F=11 >LLL</V>
<V F=12 >888</V>
</stag2
</Tag3>
</Tag1>

Desired Output
output.tsv
ABC DEF 123 ssss DDD 121
A1B2C3 D2E3F5 243 s3ds DsDD 141
AABC DDEF NULL sTUV DSDS NULL
NULL XYZ 999 NULL LLL 888

I have designed a xsl file to transform the above xml and parse it using perl. Till now my script works fine because in side Tag3/stag1/ and Tag3/stag2, we always have 3 entries. For todays file we have some stag1 amd stag2 where we have only 2 entries or 1 entris. Which causes problem and my output file has wrong number of coloumns for those entries. Now I want to check each "F" value inside stag1 amd stag2 and map it to /tag2/subtag1 /subtag2 "F" values. For each non matching, It should have null value against those years.

I don't how can I map the "F" value in stag1 and stag2 with "F" subtag1/subtag2. Can any one please help me out?

Thanks,
Siba S Nayak


Postnext
(Deleted User) Subject: need help on xsl looping
Author: (Deleted User)
Date: 20 Nov 2009 03:15 AM
Which version of Stylus Studio are you using, and which processor have you selected in the Scenario Dialog?

Alberto

Postnext
siba sankar nayakSubject: need help on xsl looping
Author: siba sankar nayak
Date: 20 Nov 2009 03:37 AM
Hi,

I ma using
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Posttop
Tony LavinioSubject: need help on xsl looping
Author: Tony Lavinio
Date: 20 Nov 2009 08:03 AM
This is not a forum for general XSLT questions, but a forum for
Stylus Studio users.

   
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.