Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 2551 invoked from network); 7 Jul 2009 10:44:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Jul 2009 10:44:55 -0000 Received: (qmail 21056 invoked by uid 500); 7 Jul 2009 10:45:04 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 21005 invoked by uid 500); 7 Jul 2009 10:45:04 -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 20994 invoked by uid 99); 7 Jul 2009 10:45:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jul 2009 10:45:04 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aklimets@day.com designates 207.126.148.183 as permitted sender) Received: from [207.126.148.183] (HELO eu3sys201aog003.obsmtp.com) (207.126.148.183) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 07 Jul 2009 10:44:54 +0000 Received: from source ([209.85.219.226]) by eu3sys201aob003.postini.com ([207.126.154.11]) with SMTP ID DSNKSlMnEKh0lg0+40zZjrAO4Q14WWJC7+PF@postini.com; Tue, 07 Jul 2009 10:44:33 UTC Received: by ewy26 with SMTP id 26so466677ewy.37 for ; Tue, 07 Jul 2009 03:44:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.20.197 with SMTP id p47mr1506134wep.13.1246963472786; Tue, 07 Jul 2009 03:44:32 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Jul 2009 12:44:32 +0200 Message-ID: Subject: Re: Query for Nodes from a given Path From: Alexander Klimetschek To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Jul 7, 2009 at 12:36 PM, BOWLER Paul wrote: > Hi, > > I need to query a subtree for specific nodes, but do not know the syntax > for this. > > Currently I have: > > def query = qm.createQuery("//pcf:Color", Query.XPATH) > return query.execute() > > This returns ALL pcf:Color nodes in the repository, but I'd like to > limit the search down a specific path (or from a specific node). > > Any ideas how I could do this? Standard xpath (except for the jcr:root prefix): /jcr:root/your/search/path//pcf:Color Regards, Alex -- Alexander Klimetschek alexander.klimetschek@day.com