W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2002

Re: [xml-dev] XPath 2.0 - how much of XQuery should it include?

From: David Carlisle <davidc@nag.co.uk>
Date: Fri, 10 May 2002 10:59:30 +0100
Message-Id: <200205100959.KAA03483@penguin.nag.co.uk>
To: jonathan.robie@datadirect-technologies.com
CC: jeni@jenitennison.com, xml-dev@lists.xml.org, public-qt-comments@w3.org


> Is it a mistake for XPath to try to incorporate so much of XQuery, or is 
> this what users really want?

Jeni's answered many of the technical issues, but just to pick up on
this question which goes I think to the heart of the problem.
The way the question is phrased highlights the warped view of history
that has caused Xpath2 to be so alien. Xpath is an existing language,
and Xquery is just a draft spec, so the question shouldn't be about
Xpath incorporating Xquery, but rather 

Why has Xquery failed to pick up on so many of the lessons learned from
over two years of Xpath use?


Look at the only comparable thing to supporting schema types in Xpath1
DTD ID support and the id() function. Have users been crying out for
more of this? No! The usual advice is to use xsl defined keys instead.

Jeni said:

  - dereferences -- id(), which does basically the same thing, is
    very rarely used because people tend to want to make their
    stylesheets robust in case DTDs aren't available for some reason,
    so use key() instead. I don't see that dereferencing will be any
    different, although if it used XML Schema identity constraints it
    would be a lot more compelling


Using XSL keys allows you to tune your index to the needs of the
stylesheet rather than whatever features the author of the dtd/schema
for that document type thought might be useful things to index on. They
also protect the stylesheet from optional behaviour by XML parsers which
might or might not report the ID information.

So what does Xpath 2 do?

Firstly it provides the bizarre => operator which is a restricted
version of id(), then for all the new types it stresses the id()
approach of inferring type information which might possibly be supplied
by a suitable parser, rather than the approach that has proved far more
robust, allowing the stylesheet to specify what types it wants to use
for the content of certain elements.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
Received on Friday, 10 May 2002 06:00:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:22 GMT