xsl-list
[Top] [All Lists]

RE: [xsl] Help to construct a loop

2007-12-30 16:58:00
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 www.exslt.org.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: henry human [mailto:henry_human(_at_)yahoo(_dot_)de] 
Sent: 29 December 2007 20:34
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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 Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>