[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] not()'ing a false variable, xalan 2.4.D1
Hi, I am trying to make a variable that is either true or false, and later doing an <xsl:if> operation with the condition being not'd, but for some reason xalan 2.4.D1 is saying that a not("variable assigned as false") is not true. Is this a bug or am I doing something wrong? Test case: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml"/> <xsl:template match="/"> <!-- make a false variable entitled 'false-variable' --> <xsl:variable name="false-variable"> <xsl:value-of select="false()"/> </xsl:variable> <xsl:text>$false-variable == </xsl:text> <xsl:value-of select="$false-variable"/> <xsl:text> </xsl:text> <xsl:choose> <xsl:when test="$false-variable"> <xsl:text>variable is true.</xsl:text> </xsl:when> <xsl:when test="not($false-variable)"> <xsl:text>variable is false.</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>This should not occur.</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> outcome: $ java org.apache.xalan.xslt.Process -in job-listing.xml -xsl test.xsl <?xml version="1.0" encoding="UTF-8"?> $false-variable == false variable is true. ? Elizabeth XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|