Joel Richard created JCR-3846:
---------------------------------

             Summary: XPath query fails with "data is not a RelationQueryNode" 
if the node name starts with a number
                 Key: JCR-3846
                 URL: https://issues.apache.org/jira/browse/JCR-3846
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: query, xpath
    Affects Versions: 2.6.2
            Reporter: Joel Richard


The query {code}/jcr:root/home/users/1//element(*,rep:User){code} fails with 
the following error:
{code}Caused by: javax.jcr.query.InvalidQueryException: Parse error: data is 
not a RelationQueryNode
        at 
org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:517)
        at 
org.apache.jackrabbit.spi.commons.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:81)
        at 
org.apache.jackrabbit.spi.commons.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:90)
        at 
org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:575)
        at 
org.apache.jackrabbit.spi.commons.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:81)
        at 
org.apache.jackrabbit.spi.commons.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:90)
        at 
org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:575){code}

If you change the node "1" to "1a", the error is even more obscure:
{code}Encountered "//" at line 1, column 34. Was expecting one of: ... ... ... 
... " ... ... ... ... ... ... ... ... ... ... ... ... "$" ... ... ... ... ... 
... ... ... ... ... ... ... ... ... ... "*" ... ... ... "(" ... "@" ... ... ... 
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... "." ... ".." ... 
... "<" ... "<" ... "{code}

Everything works fine if the node starts with a letter, for example "a1".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to