jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir Mistric" <amist...@nemours.org>
Subject RE: Xpath query with number
Date Wed, 02 May 2007 00:41:12 GMT

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


-----Original Message-----
From: Amir Mistric [mailto:amistric@nemours.org] 
Sent: Tuesday, May 01, 2007 7:33 PM
To: users@jackrabbit.apache.org
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)[@tag='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... 


View raw message