Return-Path: Delivered-To: apmail-incubator-jackrabbit-dev-archive@www.apache.org Received: (qmail 84622 invoked from network); 25 Aug 2005 21:18:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Aug 2005 21:18:54 -0000 Received: (qmail 37573 invoked by uid 500); 25 Aug 2005 21:18:53 -0000 Mailing-List: contact jackrabbit-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-dev@incubator.apache.org Received: (qmail 37560 invoked by uid 99); 25 Aug 2005 21:18:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2005 14:18:53 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of peeter.piegaze@gmail.com designates 64.233.184.202 as permitted sender) Received: from [64.233.184.202] (HELO wproxy.gmail.com) (64.233.184.202) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2005 14:19:10 -0700 Received: by wproxy.gmail.com with SMTP id 50so634872wri for ; Thu, 25 Aug 2005 14:18:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=P+OCTslsgyqNC7TfpGLG3rD2DZIx/zteFq4q2u6V1Gdr33uvgGDEje3HH7Zm//YKDxm25vi9/0lySXJaETf/Zx5f8zXaCgE70Q6a6PYftB5ZqrYR+pu/xjFS3pqxxBKRobK4CQtM4iGvw6g/xOORrjHoitUU36fi3U3VU2P4zY0= Received: by 10.54.38.60 with SMTP id l60mr1052148wrl; Thu, 25 Aug 2005 14:18:42 -0700 (PDT) Received: by 10.54.102.3 with HTTP; Thu, 25 Aug 2005 14:18:42 -0700 (PDT) Message-ID: <3df33a2505082514185fba4f9b@mail.gmail.com> Date: Thu, 25 Aug 2005 23:18:42 +0200 From: Peeter Piegaze Reply-To: peeter.piegaze@day.com To: jackrabbit-dev@incubator.apache.org Subject: Re: "instanceof" function for xpath queries In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The XPath function you are looking for is element(). For example, //element(*, nt:file) will find all the nodes in the workspace of primary type nt:file, including nodes whose primary node type is a *subtype* of nt:file. -Peeter On 8/25/05, Matthew P Foemmel wrote: > Hi all, >=20 > I was wondering if there was an easy way to search a repository for all > nodes of a specific type, including subtypes? For example, the xpath > query: >=20 > //*[@jcr:primaryType=3D'my:nodeType'] >=20 > will match all nodes with the exact type 'my:nodetype', but not nodes wit= h > types that inherit from it. I guess what I'd like to see is an "is" > function that works like the "instanceof" function in Java: >=20 > //*[is(my:nodeType)] >=20 > I've read the JSR-170 spec and checked out some of the xpath query code, > but couldn't find support for something like this. I feel like I'm missin= g > something obvious though... >=20 > Cheers, >=20 > Matthew Foemmel > ThoughtWorks, Inc. >