How to create a boolean value?
问题 I am totally new to XSLT and can't work out where I am going wrong with the following code. <xsl:variable name="var" select="boolean('false')"/> <xsl:if test="$var'">variable is true</xsl:if> It is always returning true when it is meant to be false. Why? 回答1: The value of the $var variable as defined in: <xsl:variable name="var" select="boolean('false')"/> is true() This is because in XPath " false " is an ordinary string, as opposed to false() , which is the constructor for the boolean value