Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 5045 invoked from network); 26 Feb 2009 15:49:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2009 15:49:34 -0000 Received: (qmail 77650 invoked by uid 500); 26 Feb 2009 15:49:31 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 77634 invoked by uid 500); 26 Feb 2009 15:49:31 -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 77623 invoked by uid 99); 26 Feb 2009 15:49:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2009 07:49:31 -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: domain of aklimets@day.com designates 207.126.148.182 as permitted sender) Received: from [207.126.148.182] (HELO eu3sys201aog002.obsmtp.com) (207.126.148.182) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 26 Feb 2009 15:49:22 +0000 Received: from source ([64.233.182.185]) by eu3sys201aob002.postini.com ([207.126.154.11]) with SMTP ID DSNKSaa57ai3P/KdQlRPxFmxuRDD8oQBSiYB@postini.com; Thu, 26 Feb 2009 15:49:02 UTC Received: by nf-out-0910.google.com with SMTP id 4so187176nfv.1 for ; Thu, 26 Feb 2009 07:49:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.210.127.13 with SMTP id z13mr1005610ebc.29.1235663341564; Thu, 26 Feb 2009 07:49:01 -0800 (PST) In-Reply-To: <22226806.post@talk.nabble.com> References: <22226591.post@talk.nabble.com> <510143ac0902260737h462af184qf065365df2b887c6@mail.gmail.com> <22226806.post@talk.nabble.com> Date: Thu, 26 Feb 2009 16:49:01 +0100 Message-ID: Subject: Re: How to retrieve a node from a hierarchy? 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 Thu, Feb 26, 2009 at 4:42 PM, Akil Ali wrote: > Sorry sir i dont have the information that NODE D is under A/B/C. so how to > get the NODE object of NODE D. without prior knowledge that D is under > A/B/C. Well, you could either navigate to it by looking for whatever marks that node as "D" (properties, node type, node name) or do the same with an xpath query. Typically it has a node type, let's say "my:dtype", so the query would be: //element(*, my:dtype) This gives you all nodes of type "my:dtype". If you have some additional property you want to check for, you can do this: //element(*, my:dtype)[@myprop='foobar'] which gives you all my:dtype nodes with a property set to the value "foobar". Regards, Alex -- Alexander Klimetschek alexander.klimetschek@day.com