Hi,

I am trying to build a XPath query that gets all nodes that do not have a certain (grand)child node but do have a property with a certain value

example

node1 (property=test)
 + child
    + grandchild1
    + grandchild2


node2 (property=test)
 + child
    + grandchild1


With my query I would like to find all nodes ("nodeX") that do not have a grandchild "grandchild2" but do have a property "property" with value "test".

i.e. in the example above I would like the query to return node2 (since node1 has a grandchild "grandchild2".

It doesn't matter to me if "grandchildX" is the name of the grandchild-node, or if it was in an extra name-property of the grandchild.

I tried with the grandchild names as a property (all grandchildren have the same node name) and have the following sample: //element(*,mynode)[child/grandchild/@name!='grandchild2' and @property='test']

But this also returns node1 as this has a granchild which is not grandchild2 ...


Is this possible with Jackrabbit/XPath and could someone please show me how? ;)

Thanks in advance,
Stefan

Reply via email to