[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: number(false) gives unexpected results

Subject: Re: number(false) gives unexpected results
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 13 Feb 2002 12:02:37 -0800 (PST)
xerces boolean function boolean 0
> Can anyone tell me why  in this expression:
> <img src="tab.{number(contains($input/@ACTIVE,@LABEL))}.gif" />
> the evaluation comes out as:
>tab.0.00000000000000000000000000000000000000000000000000000000000000000>
00000
>00000000000000000000000000000000000000000000000000000000000000000000000>
00000
>00000000000000000000000000000000000000000000000000000000000000000000000>
00000
>00000000000000000000000000000000000000000000000000000000000000000000133>
10712109329969.gif
> 
> when I evaluate 'contains($input/@ACTIVE,@LABEL)' it evaluates 
> correctly ('true' or 'false'), but as soon as I use the number() 
> function, I get this result. The above number is a 'false' case; the 
> true case ends in 83 instead of 69. I am using Xalan and Xerces; is 
> this a bug in the jars? I expect the evaluation to be either '1' 
> or '0'.


Must be a bug. To quote from the the second bullet in the XSLT 1.0 spec
definition of the number() function:

http://www.w3.org/TR/xpath#section-Boolean-Functions

"boolean true is converted to 1; boolean false is converted to 0"

Cheers,
Dimitre Novatchev.




__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.