[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Random indexing into a comma seperated list

Subject: RE: Random indexing into a comma seperated list
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 4 May 2001 09:15:50 +0100
xslt space seperated list
> I have a tag in deep in my XML that holds a comma (or space or
> semicolon ...) separated list of tokens:
>
> <tag>1,2,$19.95,4,five</tag>
>
> I have pulled this tag into a variable Tag:
>
> <xsl:variable name="List" select="?path to Tag?"/>
>
> With another node elsewhere in the hierarchy as the context
> node, I need to iterate n times indexing into $List.

Tackle this in two stages. First parse the comma-separated list and
construct a tree in which each value is a separate node. Then use standard
XSLT techniques to process this tree.

(You can do the first stage using the "tokenize" extension in Saxon, if you
don't like writing recursive templates)

Mike Kay
Software AG
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.