When I try to running the following xpath expression in Java using VTD-XML I get an unexpected error.
Code:
..
AutoPilot ap = new AutoPilot(vn);
ap.selectXPath("/a//b[text() = 'apple''banana']");
Error:
Syntax error after or around the end of ==> /a//b[text() = 'apple'
Caused by: com.ximpleware.XPathParseException: XPath Syntax error: #29
at com.ximpleware.xpath.parser.unrecovered_syntax_error(parser.java:492)
at java_cup.runtime.lr_parser.parse(lr_parser.java:601)
at com.ximpleware.AutoPilot.selectXPath(AutoPilot.java:809)
Is this not a bug? I was under the impression that escaping single quotes in XPath 2.0 was acceptable? When I try running the xpath query in XML Spy with the same document it runs fine.