Ok so its not just the first character but the whole name has to be encoded...
So I would split the string on "/" and then encode each token and then put it 
back together....

Seems like Xpath is much more powerful than SQL (in JCR case).
I imagine one day JCR would have something like Hibernate Criteria API that 
would actually allow you to create queries using code... 

Again thanks for the info
 
Amir

-----Original Message-----
From: Marcel Reutegger [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 03, 2007 2:50 PM
To: [email protected]
Subject: Re: Xpath query with number

Amir Mistric wrote:
> Thanks for the reply... So does only the first digit in the path slice 
> substring (between '/') needs encoding or do I just encode the whole thing?
> Also, do you recommend I use org.apache.jackrabbit.util.ISO9075 to do 
> this or something else?

yes you only need to encode the first digit because XML does not allow digits 
as the first character of a name. but there are also other characters the need 
encoding, e.g. a space. which means, you should run all names through the
ISO9075 utility when you create an XPath statement.

> P.S. Will SQL queries in Jackrabbit ever support relative paths like 
> XPath does or is this something not planned?

it is currently not planned because the JCR specification does not mention 
relative paths in the where clause and how it should work.

regards
  marcel

Reply via email to