[Xpath-ng] My favorite XPath language

David Rosenborg darolst at pantor.com
Thu Nov 21 15:51:10 MST 2002


> I'm afraid if you follow this path you will end up with XSLT x.x. Isn't
> XPath just a node selection language? Should it not stay that way?

Yes, there will probably be some overlap. But I think it's valuable
to make XPath more versatile in it self. And this is getting even
more important when it is used in non-XSLT contexts.
If you want a pure node selection language I think XPath 1.0 is
pretty good as it stands. However, if XPath NG takes a modular
approach, a minimal, node-selection profile could be created.

> Extensions can be another language, but it probably depends on the
> domain what language is best. Turning XPath into a Turing complete
> language doesn't appeal to me.

I think there are many kinds of XPath users. Some will just use
it to select nodes with say XPointer. Others use it when writing pretty
complicated XSLT transforms. The challange is to not get the
features required by the second group in the way of the first
group. Whether the language is turing complete or not
should be a non-issue for the users. There are many facilities
that are turing complete that doesn't seem to bother any one.
Like the unix command sed.

>
> >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.
> >
> Perhaps an import function might be good enough? The actual code can be
> written in whatever language.

But there is large class of problems that I come across every now and then,
that would be most naturally solved with a slightly more capable
XPath language. And if I can solve it in XPath NG and wrap into a
function library, give or sell it to other users for reuse in whatever XPath NG
environment they are using, I think much has been gained.

> >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.
> >
> That looks indeed useful to me. But it will also turn XPath from a
> selection language into a node creation language. So it will move from
> its core.

Yes, from the XPath 1.0 core, yes.

Cheers,
David




More information about the Xpath-ng mailing list