[Xpath-ng] Positional predicates (WAS: Minimal FIXPath (with a bonus)?)
David Rosenborg
darolst at pantor.com
Thu Jan 9 07:07:34 MST 2003
Hi all!
Back from breathing snow in the french alps ... some catching up to do ...
I'll start randomly with this message.
> I don't think you can drop the [1] syntax and have any user recognition
> that this is a son-of-xpath as it is just so rare to find any Xpaths
> without this, however my understanding of the optimisation problem is
> that it isn't really positional predicates that cause the problem so
> much as not knowing in time whether or not it is positional.
My take on positional predicates: leave them as they are. They
are indeed commonly used and optimization is possible and easily
detectible for most common cases. If the expression is foo [$n] and
you know nothing about $n, then you can't do much, but in most (if not all)
other cases you can.
>
> So I think we could consider a rule that made [...] positional
> only if ... is known statically at compile time to be a number.
>
I don't think this restriction is necessary. Optimization is easy enough
as it is. Actually, enforcing such a restriction might require at least as
much work as an optimizer would need to decide whether the
expression will result in a number, something not a number or
a possible number.
Cheers,
David
More information about the Xpath-ng
mailing list