summaryrefslogtreecommitdiff
path: root/tests/exslt/strings/tokenize.3.xsl
blob: 2ea6b12ea74031f89abbf6c566458c5d5c81ff1b (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
26
27
28
<?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:value-of select="text()"/>
		<xsl: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>