jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-579) "Digit" name support missing in XPath AQT parser.
Date Mon, 09 Oct 2006 12:37:21 GMT
    [ http://issues.apache.org/jira/browse/JCR-579?page=comments#action_12440877 ] 
            
Marcel Reutegger commented on JCR-579:
--------------------------------------

> This means you can't create _xpath_ queries for a path that contains an element starting
with a digit.

This statement is not correct. It is possible to create xpath queries for such elements. The
encoding scheme as described section 6.4.3 of the specification must be used.

e.g. if you have a node named '123', you can query for that node using the following query:

//_x0031_23

> "Digit" name support missing in XPath AQT parser.
> -------------------------------------------------
>
>                 Key: JCR-579
>                 URL: http://issues.apache.org/jira/browse/JCR-579
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 1.0.1
>            Reporter: Eugene Porubaev
>         Assigned To: Jukka Zitting
>            Priority: Critical
>
> 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)
> 	...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message