[xsl] Random indexing into a comma seperated list

Subject: [xsl] Random indexing into a comma seperated list
From: Dan Diebolt <dandiebolt@xxxxxxxxx>
Date: Thu, 3 May 2001 14:30:17 -0700 (PDT)
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. However
on each iteration I may need, in various places, multiple references 
to $List[$i], $List[$i-1] or $List[$i+1]. This is different than
making one pass through each token in $List. How would you
orchestrate this so the loop logic does not overwhelm the body
logic? I am looking for general techniques which make as few 
assumptions as possible as even this description is a simplification
of my task. 

Regards,

Dan


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

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


Current Thread