xsl-list
[Top] [All Lists]

RE: Splitting string

2004-08-02 14:54:05
Try a google for "recursive XSLT template to tokenize string".

There's a tokenize() function in XPath 2.0 which makes this dead easy; you
may also find that your XSLT 1.0 processor implements str:tokenize from the
EXSLT library at www.exslt.org. Otherwise you have to write a recursive
template that processes the string one word at a time: there are plenty of
examples of this in the textbooks.

Michael Kay 

-----Original Message-----
From: Rui Alberto L. Gonçalves 
[mailto:rui-l-goncalves(_at_)ptinovacao(_dot_)pt] 
Sent: 02 August 2004 22:20
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Splitting string

Hi all, 
I have a string like:
/this/is/a/test

and I need to create a template that will output:
/this
/this/is
/this/is/a
/this/is/a/test

I think this is not so simple as it looks at first glance.
Does anyone have an idea how to solve this problem?
Thanks for any help.

Rui
-- 
Rui Alberto L. Gonçalves <rui-l-goncalves(_at_)ptinovacao(_dot_)pt>
PT Inovação


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