node10-libxslt
Version:
[Fork] Node.js bindings for libxslt compatible with libxmljs
26 lines (22 loc) • 688 B
text/xml
<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>