Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 36318 invoked from network); 4 Aug 2008 09:44:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Aug 2008 09:44:10 -0000 Received: (qmail 15491 invoked by uid 500); 4 Aug 2008 09:44:09 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 15026 invoked by uid 500); 4 Aug 2008 09:44: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 15015 invoked by uid 99); 4 Aug 2008 09:44:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 02:44:08 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willscheidegger@mac.com designates 17.148.16.93 as permitted sender) Received: from [17.148.16.93] (HELO asmtpout018.mac.com) (17.148.16.93) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 09:43:11 +0000 MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Received: from [192.168.1.42] ([85.5.249.60]) by asmtp018.mac.com (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTPA id <0K5200GT9LHL0830@asmtp018.mac.com> for users@jackrabbit.apache.org; Mon, 04 Aug 2008 02:39:53 -0700 (PDT) Message-id: <6E1601BC-AB43-4A16-9F6C-031C2606A805@mac.com> From: Will Scheidegger To: users@jackrabbit.apache.org In-reply-to: <4896CD1B.4010501@anyware-tech.com> Content-transfer-encoding: quoted-printable Subject: Re: xpath queries with node names consisting of numbers? Date: Mon, 04 Aug 2008 11:39:20 +0200 References: <61F1F0BF-A60A-4526-847F-B77499AA58CF@mac.com> <4896BC0B.2020402@anyware-tech.com> <4896CD1B.4010501@anyware-tech.com> X-Mailer: Apple Mail (2.928.1) X-Virus-Checked: Checked by ClamAV on apache.org Valuable info! Thanks! Will On 04.08.2008, at 11:34, S=E9bastien Launay wrote: > The following statements are the most efficient: > //_x0031_234 > //*[fn:name() =3D '1234'] > > Note that fn:name() is only supported since Jackrabbit 1.4 and will > just not match (no exception thrown) if it is not supported =20 > (Jackrabbit > 1.3.*)... > > -- > S=E9bastien Launay > > Will Scheidegger a =E9crit : >> Hi S=E9bastien >> >> Thanks for the help! I did not now that one has to put a "fn:" =20 >> infront >> of the name() function. I gave it a try like this: >> >> /jrc:root//*[fn:name() =3D '1234'] >> >> I need the // because I don't know where in the tree the node is that >> I'm looking for. However, I'm not getting anything although the node >> exists! When I do this with an sql query, it works: >> >> select * from nt:base where jcr:path like '/%/1234' >> >> In xpath, only this works: >> >> /jcr:root//*/_x0031_234[1] >> >> Am I doing somehing wrong with he name() function or is it simply not >> supported? >> >> Regards, >> Will >> >> On 04.08.2008, at 10:21, S=E9bastien Launay wrote: >> >>> Hi Will, >>> >>> This is the same problem as described recently here: >>> http://markmail.org/message/xyvhkjjsm2igtrhb?q=3Djackrabbit >>> >>> So you must use : >>> /jcr:root/public/_x30_00 >>> or >>> /jrc:root/public/*[fn:name() =3D '000'] (only one '/' is needed for >>> direct children) >>> >>> --=20 >>> S=E9bastien Launay >>> >>> Will Scheidegger a =E9crit : >>>> I have a bunch of nodes with numbers as names. When I try to do an >>>> xpath query like >>>> >>>> /jcr:root/public/000 >>>> >>>> I get a JCR exception: javax.jcr.query.InvalidQueryException: Parse >>>> error: data is not a RelationQueryNode >>>> >>>> I also tried this: >>>> >>>> /jrc:root/public//*[name() =3D '000'] >>>> >>>> But it seems like name() is not supported by JCR. Is there a way =20= >>>> to do >>>> this? >>>> Thanks! >>>> >>>> will >> > > > --=20 > Anyware Technologies =09 > *S=E9bastien Launay* > Expert Ametys > sebastien.launay@anyware-tech.com = > > Tel : +33(0)5 61 00 06 58 > Fax : +33(0)5 61 00 51 46 > Anyware Technologies www.ametys.org > > www.ametys.fr =09 > *Nouvelle adresse > * > > = ------------------------------------------------------------------------ > *Anyware Technologies > * Lake Park > ZAC de l'Hers - All=E9e du Lac > BP 87216 > 31672 Lab=E8ge Cedex > France > www.anyware-tech.com >