Amir Mistric wrote:
Hi

I was wondering if someone can help me translate a Xpath query into SQL one.
The XPath query works like a charm untill you pass in a path with a number....

WORKS:
/jcr:root/site1/news//element(*,nt:base)[EMAIL PROTECTED]'news' and 
MetaData/@mgnl:template='np-article'] order by @date descending

FAILS:
/jcr:root/site1/news/2007//element(*,nt:base)[EMAIL PROTECTED]'news' and 
MetaData/@mgnl:template='np-article'] order by @date descending

Reason why it fails is outlined here 
(http://issues.apache.org/jira/browse/JCR-579)

Well, read that entirely and you'll find out that there is no bug, and that you need to escape the leading digit:

/jcr:root/site1/news/_x0032_007//element(*,nt:base)[EMAIL PROTECTED]'news' and MetaData/@mgnl:template='np-article'] order by @date descending

My attempts to convert this to SQL query have failed as it seems impossible to 
put child into a predicate...
Here is what I have (but it does not work):

For conversion between JCR query languages, <http://people.apache.org/~mreutegg/jcr-query-translator/translator.html> is your friend.

...

Best regards, Julian

Reply via email to