Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 66286 invoked from network); 26 Jul 2006 17:48:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jul 2006 17:48:08 -0000 Received: (qmail 33301 invoked by uid 500); 26 Jul 2006 17:48:08 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 33291 invoked by uid 500); 26 Jul 2006 17:48:08 -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 33282 invoked by uid 99); 26 Jul 2006 17:48:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jul 2006 10:48:07 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jukka.zitting@gmail.com designates 64.233.182.190 as permitted sender) Received: from [64.233.182.190] (HELO nf-out-0910.google.com) (64.233.182.190) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jul 2006 10:48:07 -0700 Received: by nf-out-0910.google.com with SMTP id o25so827202nfa for ; Wed, 26 Jul 2006 10:47:45 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=mVq+Xz84aqCPfFCuDK5SpyO6ITa4EXL/IwkSZjWME+znx2zYz3PsC5W6sFa4qYAliLJPZDskDzoTs7GrQFSMHc34JZZav6uJCINNtIhGNfq4ACBgg9b9SYR9iZAEBUYMmrwDZYekFbjWb+/eO+LxAQNdU895Q4MFoem92LGDchc= Received: by 10.78.158.11 with SMTP id g11mr3306242hue; Wed, 26 Jul 2006 10:47:45 -0700 (PDT) Received: by 10.78.34.10 with HTTP; Wed, 26 Jul 2006 10:47:45 -0700 (PDT) Message-ID: <510143ac0607261047n2c6d8421jdc1d31309ec46a5e@mail.gmail.com> Date: Wed, 26 Jul 2006 20:47:45 +0300 From: "Jukka Zitting" To: users@jackrabbit.apache.org Subject: Re: How to select nodes that do NOT have a given child in JackRabbit In-Reply-To: <5db525fa0607260943p39ac782chda273324931c3958@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5db525fa0607260943p39ac782chda273324931c3958@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, On 7/26/06, Shane O'Sullivan wrote: > I need to be able to run an XPATH query on jackrabbit that will allow me to > select all nodes that do not have a particular child. You'd need the child axis support as requested in JCR-247 to do that with XPath. It's not required by the JSR-170 nor supported by Jackrabbit, so the only way to achieve something like that is with a workaround. Some ideas: * Use an explicit property to flag the presence or absence of the child nodes you're interested. Whenever you add or remove such child nodes, you also update the flag property. You can use observation to trigger the update to avoid mixing this workaround with normal code. * Use a partial XPath query (get all "A" nodes) and filter the results with Node.hasNode("B"). * Vote for JSR-247 or contribute a patch that adds this functionality. This is likely quite hard, as the current Jackrabbit query index isn't really optimized for such access. BR, Jukka Zitting -- Yukatan - http://yukatan.fi/ - info@yukatan.fi Software craftsmanship, JCR consulting, and Java development