xsl-list
[Top] [All Lists]

RE: Splitting string

2004-08-02 14:52:25
In xsl2 this works fine.

        <xsl:variable name="tokens" select="tokenize($fn,'/')" />
        <output>
                <xsl:for-each select="1 to count($tokens)">
                        <line>
                                <xsl:value-of
select="string-join(subsequence($tokens,1,.),'/')" />
                        </line>
                </xsl:for-each>
        </output>




-----Original Message-----
From: Rui Alberto L." Gonçalves 
[mailto:rui-l-goncalves(_at_)ptinovacao(_dot_)pt] 
Sent: Monday, August 02, 2004 2:20 PM
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



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