xsl-list
[Top] [All Lists]

Re: looping over a string?

2006-01-23 04:00:30

Is there some way I could loop over each character of a variable containing
the string "ABC[...]XYZ",

in xpath2 you could use (for-example) string-to-codepoints() to get a
sequence to iterate over.

In xslt1 you'd have to use a recursive template or an extension
function. Previously when I've wanted to iterate over an alphabet I've
given myself an input document rather than a string to start with:
<x>
 <l>A</l><l>B</l>....
so that for-each over document('letters.xml')/x/l
does what you want.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>