<xsl:template match="composition"> <h3><xsl:value-of select="name"/> by <xsl:value-of select="composer"/> </h3> <ul> <xsl:if test="string(date)"> <li><xsl:value-of select="date"/></li> </xsl:if> <xsl:if test="string(length)"> <li><xsl:value-of select="length"/></li> </xsl:if> <xsl:if test="string(instruments)"> <li><xsl:value-of select="instruments"/></li> </xsl:if> <xsl:if test="string(publisher)"> <li><xsl:value-of select="publisher"/></li> </xsl:if> </ul> <p><xsl:value-of select="description"/></p> </xsl:template>
The string()
function converts the value of the element to a string
The number()
function converts the value of the element to a number
Zero length strings are false
There are all the <
, >
, =
, !=
,
<=
and >=
operators you expect