Re: XPath Version

On Tue, 2012-05-01 at 23:15 +0200, Jirka Kosek wrote:
> On 30.4.2012 16:11, Shaun McCance wrote:
> > What version of XPath will be used for ITS 2.0? ITS 1.0 says "The
> > selector attribute contains an AbsoluteLocationPath as described
> > in XPath 1.0 or its successor."
> > 
> > http://www.w3.org/TR/its/#datacategory-locations
> > 
> > But XPath 2.0 isn't entirely backwards compatible with XPath 1.0.
> > 
> > http://www.w3.org/TR/xpath20/#id-backwards-compatibility
> 
> And do we need backwards compatibility here? Backwards compatible mode
> is mainly used in XSLT where you can use XSLT 2.0 processor to run XSLT
> 1.0 stylehsheets.
> 
> If you concern was about compatibility of ITS 1.0 rules when interpreted
> as ITS 2.0 rules, then I don't think that XPath 2.0 will bring here
> anything we should be worried about.

Why would you ever not care about backwards compatibility? It's not
even just about ITS 1.0 rules interpreted by an ITS 2.0 processor.
You can have ITS 1.0 rules interpreted differently by two different
ITS 1.0 processors, because one of them chooses to exercise the "or
its successor" clause of ITS 1.0.

> > I suppose new standards probably ought to use the newest version.
> > But XPath 2.0 is considerably more difficult to implement, and a
> > full implementation requires an XSD implementation. 2.0 isn't as
> > widely implemented as 1.0, and requiring it could hurt adoption.
> 
> I think that using XPath 2.0 should not be problem. There are many
> implementations, both commercial and open-source, for many platforms.
> And XPath 2.0 doesn't require "XSD implementation" nor does it require
> source documents to be schema valid. XPath 2.0 only uses datatypes from
> XML Schema.

My understanding (from a cursory reading) is that you must apply the
schema if available to create the PSVI, which applies types to nodes.
While you don't have to implement validation, that's still a stiffer
requirement than just implementing the types.

There are certainly XPath 2.0 implementations out there, but there
are a number of prominent XML libraries that still don't support it,
such as libxml2 and lxml, and I think the XPath implementations in
both WebKit and Gecko.

Of course, the world can't stop and wait for a few tools. But using
XPath 2.0 could nonetheless hurt adoption, particularly among online
content management systems built in Python, PHP, or Ruby.

--
Shaun

Received on Tuesday, 1 May 2012 22:59:31 UTC