Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Invalid
-
1.0.1
-
None
-
None
Description
INTRODUCTION:
According to JSR-170-ch.4.6"Path Syntax" a syntactically valid path is:
...
name ::= [prefix ':'] simplename
simplename ::= onecharsimplename | twocharsimplename | threeormorecharname
onecharsimplename ::= /* Any Unicode character except: '.', '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character */
...
So, any "digit' name (e.g. "my:777") sould be valid.
WHAT I DO:
import org.apache.jackrabbit.core.query.*;
...
String q = "/jcr:root / 2 / ( *, mytype)";
QueryParser.parse( q, "xpath", nsRegistry);
WHAT I EXPECT TO HAVE:
Succesfully parsed query.
WHAT I GET:
javax.jcr.query.InvalidQueryException: Parse error: data is not a RelationQueryNode
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:434)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createPathQueryNode(XPathQueryBuilder.java:612)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:317)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:244)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:275)
at org.apache.jackrabbit.core.query.xpath.QueryBuilder.createQueryTree(QueryBuilder.java:36)
at org.apache.jackrabbit.core.query.QueryParser.parse(QueryParser.java:53)
...
P.S. The same result we have on "/jcr:root /( 2, mytype)" XPath query parsing:
javax.jcr.query.InvalidQueryException: Parse error: data is not a RelationQueryNode
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:434)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:469)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:88)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createPathQueryNode(XPathQueryBuilder.java:612)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:317)
at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:79)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:244)
at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:275)
at org.apache.jackrabbit.core.query.xpath.QueryBuilder.createQueryTree(QueryBuilder.java:36)
at org.apache.jackrabbit.core.query.QueryParser.parse(QueryParser.java:53)
...