[xslt] How do I specify "not equals to" when comparing strings in an XSLT <xsl:if>?

Currently i have a xsl with following code where I'm trying print out "count" only if it is not equal to N/A. but seems like "!=" is not working.

<xsl:for-each select="Directory/Match">
    <xsl:if test = "Count != N/A">
        <tr>
            <td><xsl:value-of select="@bookName" /></td>
            <td><xsl:value-of select="@AuthorName" /></td>
            <td><xsl:value-of select="Count" /></td>
        </tr>
    </xsl:if>
</xsl:for-each>

However, it works if I try to compare it with numeric value.

Example:

<xsl:if test = "Occurrances != 0">

Can someone please tell me: If I would like to compare strings what can I use?

This question is related to xslt xpath

The answer is


If you want to compare to a string literal you need to put it in (single) quotes:

<xsl:if test="Count != 'N/A'">