Re: XPath version

Norman Walsh wrote:
> Suppose instead we say that an implementation may use XPath 1.0 or
> XPath 2.0 at its option. For the vast majority of XPath expressions
> that are actually used in XProc, it won't make any difference.
> 
> If a pipeline that uses an XPath 2.0 expression is passed to a
> processor that only understands XPath 1.0, the user loses. This is a
> practical interoperability problem today, but we expect over the long
> term that XPath 2 will replace XPath 1 and so the interoperability
> problem will become more and more theoretical over time.
> 
> We add a note that says "for maximum interoperability, pipeline
> authors SHOULD restrict themselves to expressions that are the same in
> all versions of XPath".
> 
> I think we'd still leave the issue of type support implementation defined.

My thoughts are detailed at 
http://lists.w3.org/Archives/Public/public-xml-processing-model-comments/2007Oct/0122.html

I don't think we can simply say "use whatever version of XPath you 
like". The problem is that XPath 2.0 isn't simply a superset of XPath 
1.0, it has a different data model and a different set of typing rules. 
Users can, without too much difficulty, end up with XPath 1.0 
expressions that will work fine in engines that support XPath 1.0 and 
cause type errors in XPath 2.0, so it's not simply a matter of using 
expressions that follow XPath 1.0 syntax.

I would rather have a versioning mechanism that makes it clear what the 
user expects; at least then the XPath engine can use the backwards 
compatibility flag to ensure that things that are syntactically XPath 
1.0 will work as if the engine was using XPath 1.0.

Cheers,

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Friday, 9 November 2007 20:06:37 UTC