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

Other books

Bricking It by Nick Spalding
Kill Angel! (A Frank Angel Western #6) by Frederick H. Christian
Jessica and Jewel by Kelly McKain
88 Days to Kandahar: A CIA Diary by Grenier, Robert L.
The Shadow of Your Smile by Susan May Warren
The Pilgrim by Hugh Nissenson
All For You by Kate Perry
Points of Departure by Pat Murphy