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

RE: Help to construct a loop

Subject: RE: Help to construct a loop
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 30 Dec 2007 23:56:31 -0000
RE:  Help to construct a loop
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@xxxxxxxx]
> Sent: 29 December 2007 20:34
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  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. www.yahoo.de/mail

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.