|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Float values
A gloss on this: whether 0.00 and 0 are the same depends on whether they
are strings or numbers. Compared as strings they are not the same; compared
as numbers they are. In XSLT they could be either.
The OP has xsl:if test="TotalPaid=0". child::TotalPaid here is a node set (the set of all child TotalPaid elements of the current node). So you have to know how to compare a node-set to a number; the XPath 1.0 casting rules are invoked for this: If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true. [XPath 3.4] 0 is a number; the value 0.00 cast to a number is 0; 0 = 0 is true, so that's what we get. But if you tested "TotalPaid='0'" that would be a test against a string value; the string "0" is not equal to the string "0.00", so it would test as false. Cheers, Wendell At 11:59 AM 1/25/2004, Kenny wrote: It would be true. 0.00 and 0 are the same in XSLT. ___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_ "Thus I make my own use of the telegraph, without consulting the directors, like the sparrows, which I perceive use it extensively for a perch." -- Thoreau 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
|

Cart








