XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (287 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
13.57Mb size Format: txt, pdf, ePub

It's worth mentioning here that the rules for output of numbers are not the same as the rules for input. When a number is converted to a string, the results are determined by the casting rules given in Chapter 11. To summarize these:

  • An
    xs:integer
    value is output as an integer, for example,
    42
    or
    -315
  • An
    xs:decimal
    value with no fractional part is output as if it were an integer, with no decimal point. If it has a fractional part, it is output with at least one digit before and after the decimal point, and no other insignificant leading or trailing zeros. Examples of
    xs:decimal
    output are
    42
    ,
    -315
    ,
    18.6
    ,
    -0.0015
    .
  • An
    xs:double
    or
    xs:float
    value that's within the range 1e-6 to 1e+6 (one millionth to one million, positive or negative) is output in the same way as a decimal. Outside this range, exponential notation is used, with one significant digit before the decimal point. Examples of
    xs:double
    output are
    42
    ,
    -315
    ,
    18.6
    ,
    -0.0015
    ,
    1.003e-12
    ,
    -8.752943e13
    .

Other books

End of the Road by Jacques Antoine
Sacred Is the Wind by Kerry Newcomb
Kwaito Love by Lauri Kubbuitsile
2 The Judas Kiss by Angella Graff
Sealed with a Wish by Rose David
Gift From The Stars by Gunn, James
AZU-1: Lifehack by Joseph Picard
Deadfall by Stephen Lodge
Most of Me by Mark Lumby