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

RE: XPath number with 20 digits gives you a head ache

Subject: RE: XPath number with 20 digits gives you a head ache
From: "Jarno Elovirta" <jarno@xxxxxxxxxxxxxx>
Date: Fri, 26 Jan 2001 13:20:50 +0200
digi digits
> >   <xsl:value-of select="number(string('92125374252539897737'))" />
> >
[snip]
> > since most processors return
> >
> >   92125374252539900000
[snip]
>
> I hesitate to assert that the above is actually correct, but if you're
> getting it from several processors then the chances are that it is.

Results from XSLT processors I have on my machine:

  Output                XSLT Processor
  ======================================
  92125374252539904000  SAXON 6.1
                        Xalan-C 1.0
                        UXT 1.03.00
                        XT
  92125374252539900000  Xalan-J 2.0.D07
                        Xalan-J 1.2.2
                        MSXML 3.0
  9.21253742525399E19   Oracle V2 (beta)
  2147483647            iXSLT 2.0c

Interesting. Which, if any, is actually right?

> Incidentally calling the string() function on a string literal
> seems rather
> superfluous!

Just a desperate attempt to write a readable question :) BTW, would SAXON
optimize e.g.

  <xsl:value-of select="number(string('42'))" />

to

  <xsl:value-of select="42" />

during stylesheet preparation? And even though no one would ever write
something like

  <xsl:if test="foo[boolean(contains(., 'get something better to read')) =
boolean(number(string(substring('24',1))))]">

would it be optimized somehow before executing the stylesheet to

  <xsl:if test="foo[contains(., 'get something better to read')]">

or something in those lines? Just curious ;)

Jarno


 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.