James,

> I'm just wondering why you think that a custom location step is requried.
> e.g. your example could be reworked a little as follows...
>
> ext:related-thing(thing)[@color='red']

When designing the XML structure you have to anticipate the navigation
pattern, to ensure that everything interesting is underneath in the
hierarchy. This is often not feasible, so I find it useful to have custom
functions for jumping across the XML tree. Requiring that the function be
the first step is limiting, i.e. cannot be used for just navigating along an
idref and nothing more.

In my particular application, I combine XML and javascripting, so the custom
function can be written in javascript and embedded in the file.

> Or further location steps can be appended as needed such as
>
> ext:related-thing(thing)[@color='red']/foo/bar
>
> Without having to change the XPath grammar etc. Would that do what you
need?

For a specific purpose this is usually possible, but when all navigation
patterns are taken together, it's not always possible to design a tree where
navigation is always downward. Hence, there is a need for custom "jumps" in
the XML tree. In some application, the speed may also improved this way.

BTW, isn't this part of XPath 2.0, for these purposes?

Hallvard


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

Reply via email to