XPath query:
/a/b/as
throws an error:
{
}
If I understood correctly a XPath parser treats "as" as a reserved word. In jackrabbit code I found this:
statement = "for $v in " + statement + " return $v"; // get parser XPath parser; synchronized (parsers) { parser = (XPath) parsers.get(resolver); if (parser == null) { parser = new XPath(new StringReader(statement)); parsers.put(resolver, parser); } }
Here is a code http://grepcode.com/file/repo1.maven.org/maven2/org.apache.jackrabbit/jackrabbit-spi-commons/2.6.2/o...
In linux I've tried to execute the same XPath code using xmllint and it works:
$ xmllint --xpath '/a/b/as' test.html <as> as content </as>
Any ideas what's wrong with jackrabbit when "as" is part of a path?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Here is what I found:
I have a folder in DAM named xpath. Like this:
/content/dam/pdf/xtype
WHen i search via xpath - i get a result:
[img]XPATH1.png[/img]
Now when i do the same search on this path:
/content/dam/as/xtype
[img]xpath2.png[/img]
The error does occur. Look like you are correct - xpath and using as in the path does result in an error.
So either do 1 of 2 things:
1 - avoid using as in path
2 - try using JCR SQL to search when you use as in path
JCR SQL works:
[img]xpath3.png[/img]
Views
Replies
Total Likes
Here is what I found:
I have a folder in DAM named xpath. Like this:
/content/dam/pdf/xtype
WHen i search via xpath - i get a result:
[img]XPATH1.png[/img]
Now when i do the same search on this path:
/content/dam/as/xtype
[img]xpath2.png[/img]
The error does occur. Look like you are correct - xpath and using as in the path does result in an error.
So either do 1 of 2 things:
1 - avoid using as in path
2 - try using JCR SQL to search when you use as in path
JCR SQL works:
[img]xpath3.png[/img]
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies
Views
Likes
Replies