Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 31750 invoked from network); 5 Nov 2007 19:16:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Nov 2007 19:16:11 -0000 Received: (qmail 66411 invoked by uid 500); 5 Nov 2007 19:15:52 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 66395 invoked by uid 500); 5 Nov 2007 19:15:52 -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 66384 invoked by uid 99); 5 Nov 2007 19:15:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 11:15:52 -0800 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: local policy) Received: from [63.246.7.16] (HELO mail.mulesource.com) (63.246.7.16) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 19:16:20 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.mulesource.com (Postfix) with ESMTP id BF19E2830FB8 for ; Mon, 5 Nov 2007 13:15:31 -0600 (CST) X-Virus-Scanned: amavisd-new at X-Spam-Score: -2.512 X-Spam-Level: Received: from mail.mulesource.com ([127.0.0.1]) by localhost (mail.mulesource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qsmPt3feqg0q for ; Mon, 5 Nov 2007 13:15:29 -0600 (CST) Received: from [172.16.10.145] (adsl-76-195-248-101.dsl.pltn13.sbcglobal.net [76.195.248.101]) by mail.mulesource.com (Postfix) with ESMTP id 534412830FAA for ; Mon, 5 Nov 2007 13:15:29 -0600 (CST) Message-ID: <472F6BD0.80300@mulesource.com> Date: Mon, 05 Nov 2007 11:15:28 -0800 From: Dan Diephouse User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: users@jackrabbit.apache.org Subject: Re: predicate with descendant child References: <76a6ebd00711051050n4b2bff96w59595a65f9936be4@mail.gmail.com> <472F663F.8090502@mulesource.com> <76a6ebd00711051110y1b7940e5sf21a83f68eed5189@mail.gmail.com> In-Reply-To: <76a6ebd00711051110y1b7940e5sf21a83f68eed5189@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.512 tagged_above=-10 required=6.6 tests=[AWL=0.087, BAYES_00=-2.599] "/"s can not go inside the brackets. They must always go outside i.e. parents//*[@years='10']. - Dan Mark Waschkowski wrote: > Hi Dan, > > Doh, I forgot to mention that I need a particular branch, and realized > my example isn't very good. I'll try again. > > I have the following: > > /parent1/childJack/years=10 > /parent2/childJill/years=12 > /parent3/childJohn/years=35 > /parent3/childJohn/childSuzy/years=10 > > I need the _adults_ that have children or grandchildren that are 10 > years old because we are running a special promotion for 10 year olds, > and need to notify the adults of it. > > I would like to write this: > > parents[//@years= '10'] > > but no go. > > Any ideas? > > Thanks, > > Mark > > > > > > On Nov 5, 2007 1:51 PM, Dan Diephouse wrote: > >> Mark Waschkowski wrote: >> >>> Hi, >>> >>> I'm trying many different combinations to specify a predicate where >>> ALL child nodes have some particular value. In other words, I would >>> like to get all regions that have any children nodes that have a >>> yearBuilt attribute of 2001. >>> ie. documents/regions[//@yearBuilt = '2001'] >>> >>> I tried different combinations of factors but could only make the >>> predicate apply if I knew what level the child was at: >>> ie. documents/regions[*/@yearBuilt = '2001'] >>> >>> but in our case we don't always know the level, hence the need to >>> apply a predicate using a descendant node. Is this possible? If not, >>> are there any workarounds? >>> >>> Thanks, >>> >>> Mark >>> >>> >> I think the correct xpath syntax is: documents/regions//*[@yearBuilt = >> '2001']. >> Cheers, >> - Dan >> >> -- >> Dan Diephouse >> MuleSource >> http://mulesource.com | http://netzooid.com/blog >> >> >> -- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com/blog