At 3:35 AM +0000 3/21/02, James Strachan wrote:
>After looking at XPath 2.0 which introduces XSD types, maybe we should
>return java.lang.Number again?
>

No, XPath 2.0 is huge, not done anytime soon, and from Jaxen's 
perspective a major change. Do not expect that you'll be able to make 
a few changes here and there and have Jaxen work with XPath 2.0. 
You're going to need to redesign most of the API. I would pay 
absolutely no attention to XPath 2.0 for the time being.   Focus on 
making a complete 1.0 implementation which is useful in and of 
itself. In fact, for Java developers I think XPath 1.0 is a much 
better fit than XPath 2.0. The complications in XPath 2.0 are mostly 
due to the needs of XQuery and XSLT 2.0. There are a few nice 
features for Java programs (the ability to specify the default 
namespace for use in XPath expressions would be convenient) but 
nothing we can't live without.

Later you may want to design a separate XPath 2.0 API, but it won't 
be at all the same thing. For example, in the case at hand, XPath 2.0 
has no number type as such. Thus there should not be a numberValueOf 
method. Instead there are separate and related decimal, double, 
float, int, byte, short, long, Integer, nonNegativeInteger, 
nonPositiveInteger, positiveInteger, negativeInteger, and probably a 
few others I've forgotten.

There are much more serious differences too. The most important is 
probably that the whole model is based on sequences rather than the 
four fundamental XPath 1.0 types. Sequences can contain nodes or 
primitive types, and as you noticed the types are not the same in 
XPath 2.0. Sequences are ordered and can contain duplicates. Whereas 
an XPath 1.0 expression might return a node-set, an XPath 2.0 
expression might return a sequence containing both nodes and 
non-nodes. I just don't think you're going to be able to reconcile 
an XPath 1.0 API with an XPath 2.0 API.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | [EMAIL PROTECTED] | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to