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
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.

 
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.