OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transitive closure for XPath

> The proposal as described slightly breaks the XPath evaluation
> model though: the second argument to 'closure(node-set,node-set)'
> has Algol-style call-by-name semantics.  That is, it's not really
> a node-set but rather an XPath expression or "thunk" which
> is re-evaluated with a different context multiple times.
> I think this calls for new syntax, either a new keyword or operator.

Damn someone noticed :) But, to be serious, yes it breaks the XPath grammar.
I just wrote it up quickly, but..

>     closure(/ROOT/node[1], id(./@child))
> in your example would be written:
>     /ROOT/node[1]/(id(./@child))*

as you pointed out, evaluating the first in an existing xpath engine is a
lot easier, since you just need to plug in another function.

From a logical point of view, perhaps a new axis (e.g.
/root/node[1]/closure::id(./@child)) would make sense, but a new function is
a lot easier to implement..