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

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

Very large and very small floating point numbers are now output using scientific notation (or the programmer's variant of scientific notation); for example,
1.5E-9
. If this output format isn't acceptable, you can use the
format-number()
function to control the format you want.

There are some changes to the specification of
format-number()
. In most cases these are tightening up a specification that was previously rather vague in certain areas, but the result of this is that a conformant XSLT 2.0 processor may do things differently from the way that your favorite 1.0 processor interpreted the specification. These changes are caused by the fact that XSLT 1.0 defined
format-number()
in terms of an old version of the Java
DecimalFormat
class, and this dependency has now been removed.

There are also changes to the rules for converting strings to numbers. Strings containing a leading plus sign are now recognized (previously they were treated as NaN), as are the strings
INF
and
-INF
for positive and negative infinity, replacing
Infinity
and
-Infinity
.

Other XPath Changes

Constructs such as
A
=
B
=
C
, or
A
<
B
<
C
were allowed in XPath 1.0 but are disallowed in XPath 2.0. This is because their actual meaning was wildly different from their intuitive meaning, making them a probable cause of bugs. For example, in XPath 1.0
1
=
2
=
0
is true, because
(1 = 2)
is false, and
false()
=
0
is true.

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

Other books

Airel by Patterson, Aaron, White, C.P.
Chasing Forevermore by Rivera, J.D.
Metropolitan by Walter Jon Williams
The Werewolf Bodyguard (Moonbound Book 2) by Camryn Rhys, Krystal Shannan
Prison Nation by Jenni Merritt
Canyon of the Sphinx by Kathryn le Veque
The Zodiac Collector by Laura Diamond