[Xpath-ng] My favorite XPath language
David Rosenborg
darolst at pantor.com
Thu Nov 21 06:12:07 MST 2002
Hi Berend!
> 1. What is *wrong* with Xpath.
XPath 1.0 is very good, but there are some parts missing.
In XPath 2.0 the major wrong parts are the XML Schema/type bloat
and its incompatibility with XPath 1.0.
>
> 2. What should be added to Xpath, and *why* can't we do without.
Actually many good things are added in XPath 2.0 like
an if expression, a for expression, quantified expressions etc.
Which we can do with and without should be sorted out
here over time.
>
> 3. Can't we create a better Xpath by taking things away?
>
IMO, from XPath 1.0, no, from XPath 2.0 yes.
> Perhaps you can add the why to your list David? To me it just looks like
> a "cool stuff to add" list, not really enhancing what we can do know
> (except the functions).
Yes, but I thought it would be a good thing to bring all the ideas pretty unqualified
to the table first. Kind of brainstorming. Then we can sort out the donts, maybes,
nice-to-haves and must-haves.
Anyway, here's a couple of whys to start with:
Why self-sufficient?
--------------------------
Originally XPath was developed in the context of a single host language, XSLT.
Now it's used in other situations like XPointer and some schema languages.
And I think it will be used in even more situations in the future. The purpose
of the self-sufficiency aspect is to increse the "pluggability" of XPath. The
host envrionment may for example know nothing about namespaces. Then,
instead of inventing a new namespace declaration mechanism for each
new host language, XPath Ng could come with its own.
This aspect is also much related to "the means of abstraction". XPath 1.0
has no means of abstraction. Adding user defined functions would
be a great step filling that hole. And I'd rather have the function mechanism
inside XPath Ng rather to be depending a host language. The reason for that
is that it would be valuable to reuse libraries of user defined functions
indenpendent of host language. And to be able to create indenpendent
libraries of user defined functions you would need variable binding
and namespace declaration primitives.
Why function library import?
--------------------------
This might be more of a nice to have, but if widespread use of libraries of user
defined functions become a reality, a library import facility would make
their usage more convenient.
Why list type?
--------------------------
As soon as you start using functions you'll find situations where you
want to return more then one value, or pass arbitrary structures,
containing values of arbitrary types, as arguments. A simple list
data type enables all that.
Cheers,
David
More information about the Xpath-ng
mailing list