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
Eric DeanSubject: Any good way to handle repeating, paired tags using XSLT?
Author: Eric Dean
Date: 04 Jun 2010 05:57 PM
I have a source XML document that has been provided to me and I have no control over it's format. It has header-level information as well as detail level information. At both the header and detail levels there are generic, paired tags used to contain data that doesn't have a place in the document.

Example:

<Header>

...Normal header-level XML structure here...

<ExtendedInfo>
<Name>Blah</Name>
<Value>Blah's Value</Value>
</ExtendedInfo>
<ExtendedInfo>
<Name>More Stuff</Name>
<Value>More Stuff's Value</Value>
</ExtendedInfo>

...ExtendedInfo continues many times...

</Header>

The problem is that there can be dozens of these "ExtendedInfo" tags. Many I don't care about but others I need to use throughout the target document. They represent completely unrelated data that would not be logically grouped together and I would use the value of the <Name> tag to determine if/how to use the data in the output.

My initial thought was to parse them all up front using a for-each, store the ones I care about in variables and use those variables later. Seems that I can't do this, however, as the variables would be out of scope.

The only way I can see to do it would be to have a for-each everywhere that I need data from one of these nodes. This would be extremely inefficient, however, as I would have to go through them all, checking the value of the <Name> node many times, everywhere that I needed data from one of these tags in the target.

Hopefully my ignorance is just causing me to miss something obvious. I'd really appreciate any help.

Thanks,
Eric

Posttop
Tony LavinioSubject: Any good way to handle repeating, paired tags using XSLT?
Author: Tony Lavinio
Date: 07 Jun 2010 10:18 AM
These boards are part of the Stylus Studio Developer Network. They are a service to users of Stylus Studio only.

* If your copy of Stylus Studio is registered under a different email address from the one you are using on this board, please include the version of Stylus Studio you are using with your question. The version number can be seen under Help>About next to the words "Framework version" and will look something like "1291a" or "1386a".

* For general XSLT-related questions, even those seen under Stylus Studio but obviously not related to Stylus Studio in particular, please post questions on the xsl-list mailing list.

 
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.