Skip to content

Instantly share code, notes, and snippets.

@andrewminton
Created June 21, 2012 17:07
Show Gist options
  • Save andrewminton/2967054 to your computer and use it in GitHub Desktop.
Save andrewminton/2967054 to your computer and use it in GitHub Desktop.
<data>
<hello>List or not to list</hello>
<entry>
<item>1</item>
</entry>
</data>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<h1>
<xsl:value-of select="data/hello" />
</h1>
<xsl:choose>
<xsl:when test="count(//data/entry/item) &gt; 1">
<xsl:text>This is multiple items</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>This is a single item</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment