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
4.99Mb size Format: txt, pdf, ePub
ads

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
    .
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
4.99Mb size Format: txt, pdf, ePub
ads

Other books

The Price of Valor by Django Wexler
Vacuum Flowers by Michael Swanwick
Ollie's Easter Eggs by Olivier Dunrea
The Hook by Raffaella Barker
Time Bandit by Andy Hillstrand