test="" on a boolean always returns true

Posted by user70448 on Stack Overflow See other posts from Stack Overflow or by user70448
Published on 2010-06-03T20:10:35Z Indexed on 2010/06/05 16:42 UTC
Read the original article Hit count: 210

Filed under:
|
|
|
|

Why does

<xsl:if test="<XPATH to boolean value here>">
...
</xsl:if>

ALWAYS return true?

Since boolean can be 0,1,"false" and "true" by definition, the ONLY way to test for a boolean value is to do string comparison against these. This can't be right.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt