|
I use easypo sample to study how to use XPath to select XML according to the instruction in conSelectingXMLwithXQueryPathXPath.html
For the following query express, String pathText =xqNamesapce + "$this//po:[EMAIL PROTECTED]'ss']"; Customer[] customers = (Customer[])poDoc.selectPath( queryText ) ; I got the following exception: java.lang.RuntimeException: net.sf.saxon.xpath.StaticError: XPath syntax error at char 5 in {$this//po:customer}: Variable $this has not been declared
If I change the express to (replace “$this” with “.”): String pathText =xqNamesapce + ".//po:[EMAIL PROTECTED]'ss']"; The code works well.
If I use executeQuery() instead of selectPaht(), I find that I have to use “$$this” or “.” to replace “$this” in the above pathText string, or no result is found. I also find that the return type of the executeQuery() is XmlAnyTypeImpl, instead of CustomerImpl.
I do not know if I configure my runtime environment incorrectly or I misunderstand the content in conSelectingXMLwithXQueryPathXPath.html?
Thanks for your help very much.
Guofeng
|
- RE: selectPath and executeQuery: the result is different, wh... Guofeng Zhang
- RE: selectPath and executeQuery: the result is differen... Yana Kadiyska
- RE: selectPath and executeQuery: the result is differen... Guofeng Zhang
- RE: selectPath and executeQuery: the result is differen... Yana Kadiyska
- RE: selectPath and executeQuery: the result is differen... Guofeng Zhang

