Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3846

XPath query fails with "data is not a RelationQueryNode" if the node name starts with a number

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.6.2
    • None
    • query, xpath
    • None

    Description

      The query

      /jcr:root/home/users/1//element(*,rep:User)

      fails with the following error:

      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)

      If you change the node "1" to "1a", the error is even more obscure:

      Encountered "//" at line 1, column 34. Was expecting one of: ... ... ... ... " ... ... ... ... ... ... ... ... ... ... ... ... "$" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... "*" ... ... ... "(" ... "@" ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... "." ... ".." ... ... "<" ... "<" ... "

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            joelrich Joel Richard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: