4 messages in org.apache.jackrabbit.usersEscaping XPATH Queries and more
FromSent OnAttachments
Steven GithensOct 12, 2007 8:58 am 
Julian ReschkeOct 15, 2007 1:45 am 
Steven GithensOct 19, 2007 5:50 am 
Julian ReschkeOct 19, 2007 6:21 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Escaping XPATH Queries and moreActions...
From:Steven Githens (sgit@caret.cam.ac.uk)
Date:Oct 12, 2007 8:58:18 am
List:org.apache.jackrabbit.users

Hello,

I started using more formats for my folder names today and realized they aren't XML Element correct and the XPATH query blew up.

I tried escaping:

//site/2f43f30b-f1cc-4b62-803b-dd37c2be1693/mail/messagefolder001/* order by @sakaijcr:message-date ascending

to:


//site/48c035bd_x002d_8873_x002d_4674_x002d_80e5_x002d_0c5618c3f754/mail/messagefolder001/* order by @sakaijcr:message-date ascending

after reading seciton 6.4.3 in JSR170, but I still get:

Lexical error at line 1, column 26. Encountered: "_" (95), after : "": Lexical error at line 1, column 26. Encountered: "_" (95), after : "" javax.jcr.query.InvalidQueryException: Lexical error at line 1, column 26. Encountered: "_" (95), after : "": Lexical error at line 1, column 26. Encountered: "_" (95), after : "": Lexical error at line 1, column 26. Encountered: "_" (95), after : "" at
org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:267)

Any ideas on how to correclty escape that? I don't use a lot of XPATH outside this, so I'm hoping it's something obvious, but a bit of googling didn't turn up much for me.

Also, I'm wondering what the best way to proceed on to JCR 2 for portable queries is. After going through JSR-283 it looks like XPATH is deprecated and there is a new version of the SQL querying. While JSR-170 had a fair number of example queries, JSR-283 seems to not have any examples at all, so I'm not sure what the difference between the grammers really is.

Any ideas on ways the best way to write your queries so there will be minimal maintenence after JCR2 is ready in JackRabbit?

Thanks! Steve