[Xpath-ng] My favorite XPath language

Berend de Boer berend at xsol.com
Thu Nov 21 11:32:36 MST 2002


David Rosenborg wrote:

>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.
>
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?

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.

>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.


>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.
>
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.

Regards,

Berend. (-:




More information about the Xpath-ng mailing list