A web service demonstrating how to use the XmlCursor.selectPath method to execute an XPath expression. Unlike the execQuery method, which returns an XmlCursor containing the results of the query, the selectPath method updates the content of the cursor it is called from.
In other words, for a method call such as myCursor.selectPath("$this/elementName"), the myCursor variable would afterward contain the query results. If there were multiple elementName elements returned, you could use "selection" methods to navigate among the elementName elements and access them individually. "selection" methods include toNextSelection, toPreviousSelection, getSelectionCount, addToSelection, and so on.
For more information on using XPath and XQuery with the selectPath method, see Selecting XML with XQuery and XPath.
This sample is located in the xmlBeans/xquery folder of the SamplesApp WebLogic Workshop project. In the file system the location is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\WebServices\xmlBeans\xquery\SelectPath.jws
To Run the Sample
BEA_HOME/weblogic81/samples/domains/workshop/startWebLogic.sh