RE: [xsl] Help to construct a loop

Subject: RE: [xsl] Help to construct a loop
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 30 Dec 2007 23:56:31 -0000
In XSLT 2.0 it can be done like this:

<xsl:for-each select="tokenize($myString, ':')">

In XSLT 1.0 it's more difficult. Some processors have an extension function
(perhaps called str:tokenize()) that behaves similarly to the XSLT 2.0
solution. In the absence of such a function, you need to use a recursive
template that makes use of the contains(), substring-before(), and
substring-after() functions. You can find an example of such a recursive
template in the EXSLT library at

Michael Kay

> -----Original Message-----
> From: henry human [mailto:henry_human@xxxxxxxx]
> Sent: 29 December 2007 20:34
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Help to construct a loop
> Hi
> I will to build a loop (for-each or while, etc)
>   I have a long string saved in a variable myString:
>     myString= foo ffd : ppp ttt foo : 3mmm foo
>   In this sample there are three substrings separated by a colon token
>   How could it be done, looking over the myString in a loop and f. i.
>  save the substring in a variable named buf1  until all three
> substrings  has been read  ?
>   I will be very glad for any hint
>   Regards
>   Henry
>       Heute schon einen Blick in die Zukunft von E-Mails
> wagen? Versuchen Sie4s mit dem neuen Yahoo! Mail.

Current Thread