summaryrefslogtreecommitdiff
path: root/tests/exslt/strings/tokenize.3.xml
blob: 9d5c2937e027c2f06775d0f7335d6f6138f993cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:str="http://exslt.org/strings"
                version="1.0">

<xsl:template match="/">
	<xsl:for-each select="//string">
		<xsl:text><xsl:value-of select="text()"/></xsl:text>
		<xsl:for-each select="str:tokenize(text(), '/')">
			    <xsl:text>   '</xsl:text>
			    <xsl:value-of select="."/>
			    <xsl:text>'</xsl:text>
		</xsl:for-each>
	</xsl:for-each>
</xsl:template>

<xsl:template name="foobar">
	<string>/foo/bar</string>
	<string>//foo/bar</string>
	<string>foo//bar</string>
	<string>foo/bar/</string>
	<string>foo/bar//</string>
</xsl:template>

</xsl:stylesheet>