Hi,

On 7/26/06, Shane O'Sullivan <[EMAIL PROTECTED]> wrote:
I need to be able to run an XPATH query on jackrabbit that will allow me to
select all nodes that do not have a particular child.

You'd need the child axis support as requested in JCR-247 to do that
with XPath. It's not required by the JSR-170 nor supported by
Jackrabbit, so the only way to achieve something like that is with a
workaround. Some ideas:

* Use an explicit property to flag the presence or absence of the
child nodes you're interested. Whenever you add or remove such child
nodes, you also update the flag property. You can use observation to
trigger the update to avoid mixing this workaround with normal code.

* Use a partial XPath query (get all "A" nodes) and filter the results
with Node.hasNode("B").

* Vote for JSR-247 or contribute a patch that adds this functionality.
This is likely quite hard, as the current Jackrabbit query index isn't
really optimized for such access.

BR,

Jukka Zitting

--
Yukatan - http://yukatan.fi/ - [EMAIL PROTECTED]
Software craftsmanship, JCR consulting, and Java development

Reply via email to