From users-return-15377-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Fri Jun 04 11:40:13 2010 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 33689 invoked from network); 4 Jun 2010 11:40:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Jun 2010 11:40:12 -0000 Received: (qmail 79343 invoked by uid 500); 4 Jun 2010 11:40:12 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 79213 invoked by uid 500); 4 Jun 2010 11:40:10 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 79204 invoked by uid 99); 4 Jun 2010 11:40:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jun 2010 11:40:09 +0000 X-ASF-Spam-Status: No, hits=-0.8 required=10.0 tests=AWL,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aklimets@day.com designates 207.126.148.87 as permitted sender) Received: from [207.126.148.87] (HELO eu3sys201aog101.obsmtp.com) (207.126.148.87) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 04 Jun 2010 11:40:03 +0000 Received: from source ([209.85.211.190]) by eu3sys201aob101.postini.com ([207.126.154.11]) with SMTP ID DSNKTAjl/My2krdXtWkFRVs/GfW0yrMWPkZw@postini.com; Fri, 04 Jun 2010 11:39:42 UTC Received: by ywh28 with SMTP id 28so1057819ywh.28 for ; Fri, 04 Jun 2010 04:39:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.130.40 with SMTP id h40mr11571889ann.45.1275651579695; Fri, 04 Jun 2010 04:39:39 -0700 (PDT) Received: by 10.100.7.19 with HTTP; Fri, 4 Jun 2010 04:39:39 -0700 (PDT) In-Reply-To: <1275636154561-2242779.post@n4.nabble.com> References: <1275636154561-2242779.post@n4.nabble.com> Date: Fri, 4 Jun 2010 12:39:39 +0100 Message-ID: Subject: Re: strange query From: Alexander Klimetschek To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Fri, Jun 4, 2010 at 08:22, gft 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