On Fri, Jun 4, 2010 at 08:22, gft <[email protected]> wrote:
>
> I'm working with jackrabbit 2.0.1
>
> I have the following query (that I thought should be correct):
> //element(*, xyz:tag)[...@xyz:owner = '%s' and jcr:deref(@xyz:documentRef,
> '*')/@xyz:public = 'true']

I guess you have to wrap the jcr:deref part in brackets:

//element(*, xyz:tag)[...@xyz:owner = '%s' and
(jcr:deref(@xyz:documentRef, '*')/@xyz:public = 'true')]


> where xyz is a namespace I defined and xyz:documentRef's type is 'Reference'
>
> I get an error during the compilation of the query
>
>
> I found that this other query works:
> //element(*, xyz:tag)[...@xyz:owner = '%s'][jcr:deref(@xyz:documentRef,
> '*')/@xyz:public = 'true']

Multiple predicates ([...]) are possible in Xpath and they are
combined with AND, eg. "[a][b]" is the same as "a AND b".

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to