[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Incompatibilities XPath 1.0 vs 2.0?

Subject: Incompatibilities XPath 1.0 vs 2.0?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 2 Jan 2002 22:18:35 +0000
xpath 1.0 vs 2.0

I *think* that there are some problems with backwards compatibility
that aren't listed in Appendix D of the XPath 2.0 WD.

Section Predicates:

 "If the value of the predicate expression is one simple value of a
  numeric type, the value is rounded to an integer using the rules of
  the round function, and the predicate truth value is true if and
  only if the resulting integer is equal to the value of the context

I haven't got access to the XPath 1.0 errata at the moment, but at
least some of the implementations (Saxon and Xalan) seem to round down
(floor) numeric predicates rather than rounding them (round).


Also, I think the definition for predicates changes what happens when
the predicate expression evaluates to a string. In XPath 1.0, the
string is converted to a boolean (an empty string to false, a string
with characters to true), and this is used. For example:


returns text nodes whose value contains non-whitespace characters. It
appears from the description in Section that this expression
will now raise an error, since it is not an empty sequence, not a
numeric type, not boolean, and not a sequence of nodes.


On a similar note, Section 2.7 Logical Expressions doesn't seem to
handle situations where the expressions are other than nodes or
boolean values. What about if one of the operands is a string or a
number? No mention is made of the required types of the comparison or
how other values are cast to boolean values, which presumably they
should be.


In Appendix A.3, it says:

 "A space may be significant after "/" or "//", in order to
  distinguish, for instance "//div" and "// div foo" without lookahead."

This was not the case in XPath 1.0 (where you could do / div div 3
quite happily if you felt so inclined). (I don't think there's a
problem with "//" - that's not a valid path expression anyway.)


Jeni Tennison

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.