Check if a string is null or empty in XSLT

How can I check if a value is null or empty with XSL?

For example, if categoryName is empty? I’m using a when choosing construct.

For example:

<xsl:choose>
    <xsl:when test="categoryName !=null">
        <xsl:value-of select="categoryName " />
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="other" />
    </xsl:otherwise>
</xsl:choose>

14 Answers
14

Leave a Comment