On Sun, 2 Sep 2001, bob mcwhirter wrote:

>
> No, absolutely not being combative; I really like Dmitri.
>
> His recent release of JXPath does some cool things that I'd
> like to try to add support for.
>
> Specifically, the notion of intelligent proximity predicates.
>
> He makes a good point about for at least the JavaBean model,
> foo/bar[3] should pretty much be an array-like access, and
> not an iterator-based sequential search.  Perfect sense.

Certainly. If a Navigator can provide more efficient access, it should
certainly do so, and array-based access would also make it faster when the
axis is reversed (in PrecedingSiblingAxisIterator, for example).

I feel you should be careful though because there are plenty possible
optimizations. This one seems simple and useful.

> Of course, we're entirely Iterator-based, so I'm not sure
> what we can do.  But, I'd definitely like to take a look at
> what he's doing, and still attempt the Grand Unified Engine
> for xpaths.

The optimization is probably most useful on the child axis.

One caveat; you're also doing a nametest in "foo/bar[3]". So it would only
match the third bar element.
I'd say either of these method in Navigator (and default implementations
in DefaultNavigator):

Object[] getChildAxisArray(Object contextNode, String namespaceURI,
String localName);
Object getChildAxisAt(String namespaceURI, String localName, int index);

The first method has the advantage that it also speeds up "foo/bar"
without an index predicate.

Greetings,
  Erwin



_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to