Hmm

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..

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"....
Any help is appreciated...




Thanks
 
Amir

-----Original Message-----
From: Amir Mistric [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 01, 2007 7:33 PM
To: [email protected]
Subject: Xpath query with number

Hi all


I am trying to pull some data from Magnolia's Jackrabbit repository and am 
having a difficulty with the following Xpath query.


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


The error I get is


javax.jcr.query.InvalidQueryException: Parse error: data is not a 
RelationQueryNode
        at 
org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:448)
        at 
org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80)
...



The weird thing is that if I omit '2006' from the above query it works...
So, I guess is there a special way of 'encoding' the number in Xpath query or 
do I need to do something else... 


Thanks

Amir

Reply via email to