Marcel 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?
P.S. Will SQL queries in Jackrabbit ever support relative paths like XPath does or is this something not planned? Thanks Amir -----Original Message----- From: Marcel Reutegger [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 02, 2007 5:11 AM To: [email protected] Subject: Re: Xpath query with number Hi Amir, Amir Mistric wrote: > According to this issue (http://issues.apache.org/jira/browse/JCR-579) > , Id be better off to use SQL syntax. But now I have a different > problem...How do I achieve the same result in SQL? I haven't been able > to query MetaData part.. I think you should still use XPath and use the encoding as specified in jsr 170. > In another words this does not work: > > SELECT * FROM nt:base WHERE jcr:path LIKE > '/www-site1-org/mediaroom/press/2006[%]/%' AND tag='news' AND > mgnl:template='np-article' > > I am guessing because 'tag' and 'mgnl:template' are not on the same > "level".... The query you have cannot be expressed in SQL because SQL does not support relative paths in an expression. > Any help is appreciated... You should use XPath and encode the node name: /jcr:root/www-site1-org/mediaroom/press/_x0032_006//element(*,nt:base)[EMAIL PROTECTED]'news' and MetaData/@mgnl:template='np-article'] order by @date descending regards marcel
