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

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.

Other books

Crash Diet by Jill McCorkle
Tokyo Surprise by Alex Ko
Rousseau's Dog by David Edmonds
Yield by Cari Silverwood
Honeybath's Haven by Michael Innes
Enemy Invasion by A. G. Taylor
Manalive by Gilbert Keith Chesterton
Adulation by Lorello, Elisa
Oz - A Short Story by Ann Warner