jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: How to do this JCR XPath query
Date Thu, 29 Apr 2010 08:58:54 GMT
2010/4/29 Fran├žois Cassistat <f@maya-systems.com>:
> Thanks for your answers and sorry if I was not clear enough.
>
> What I need is to test more than one property on a subnode, and maybe need to do these
tests on more than one subnodes. For example, if it was XML, I could write something like
this :
>
> //node[child::*[@att1='a' and @att2='b'] and child::*[@att1='c' and @att2='d'] and ...]
>
> Theses informations cannot be stored in the name or the node type (non-unique user-provided
strings with no SNS allowed).

I see, you still want to return the parent node, but check for
properties of children with unknown names. Yes, this is not possible
with JCR XPath. With JQOM/JCR-SQL2 it should be possible, but I don't
know how to build that query ;-)

Another solution could be to enhance the content model that the child
nodes have well-known names. Or, the solution that is a bit ugly, use
a query that returns the child nodes and on the nodes in the result
set go up the ancestor path.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message