Skip to content

Instantly share code, notes, and snippets.

@bsuh
Created June 14, 2012 19:52
Show Gist options
  • Save bsuh/2932529 to your computer and use it in GitHub Desktop.
Save bsuh/2932529 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:libxslt="http://xmlsoft.org/XSLT/namespace"
version="1.0" exclude-result-prefixes="libxslt">
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="test">
<a>
<b/>
</a>
</xsl:variable>
<xsl:template match="/">
<out>
<xsl:value-of select="count( libxslt:node-set($test)//* )"/>
</out>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment