jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: strange query
Date Fri, 04 Jun 2010 11:39:39 GMT
On Fri, Jun 4, 2010 at 08:22, gft <gianfranco.tognana@gmail.com> 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
alexander.klimetschek@day.com

Mime
View raw message