The following statements are the most efficient: //_x0031_234 //*[fn:name() = '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 (Jackrabbit 1.3.*)... -- Sébastien Launay Will Scheidegger a écrit : > Hi Sébastien > > Thanks for the help! I did not now that one has to put a "fn:" infront > of the name() function. I gave it a try like this: > > /jrc:root//*[fn:name() = '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ébastien Launay wrote: > >> Hi Will, >> >> This is the same problem as described recently here: >> http://markmail.org/message/xyvhkjjsm2igtrhb?q=jackrabbit >> >> So you must use : >> /jcr:root/public/_x30_00 >> or >> /jrc:root/public/*[fn:name() = '000'] (only one '/' is needed for >> direct children) >> >> -- >> Sébastien Launay >> >> Will Scheidegger a écrit : >>> 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() = '000'] >>> >>> But it seems like name() is not supported by JCR. Is there a way to do >>> this? >>> Thanks! >>> >>> will > -- Anyware Technologies <http://www.anyware-tech.com> *Sébastien Launay* Expert Ametys [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Tel : +33(0)5 61 00 06 58 Fax : +33(0)5 61 00 51 46 Anyware Technologies <http://www.ametys.fr> www.ametys.org <http://www.ametys.org> www.ametys.fr <http://www.ametys.fr> *Nouvelle adresse * ------------------------------------------------------------------------ *Anyware Technologies * Lake Park ZAC de l'Hers - Allée du Lac BP 87216 31672 Labège Cedex France www.anyware-tech.com <http://www.anyware-tech.com>
