| java.lang.Object org.apache.xmlbeans.samples.xquery.XQueryXPath
XQueryXPath | public class XQueryXPath (Code) | | A sample to XMLBeans API features for executing XPath and XQuery
expressions. The sample illustrates these features:
- Using the XmlObject.selectPath and XmlCursor.selectPath methods
to execute XPath expressions. The selectPath method's results (if
any) are always chunks of the instance queried against. In other
words, changes to query results change the original instance.
However, you work with results differently depending on whether
selectPath was called from an XmlObject or XmlCursor instance. See
the SelectPath class for more information.
- Using the XmlObject.execQuery and XmlCursor.execQuery methods
to execute XQuery expressions. Results of these queries are copied
into new XML, meaning that changes to results do not change the
original instance. Here again, you work with results differently
depending how which method you used to query. See the ExecQuery
class for more information.
|
Method Summary | |
public boolean | executeQueries(String[] args) Returns true if all of the sample methods returned true
(i.e., their query expressions returned results).
Parameters: args - An array in which the first item is apath to the XML instance file. | public static void | main(String[] args) Receives an employees list XML instance, passing the instance to
methods that execute queries against it. | public XmlObject | parseXml(String xmlFilePath) Creates a File from the XML path provided in main arguments, then
parses the file's contents into a type generated from schema.
Parameters: xmlFilePath - A path to XML based on the schema in inventory.xsd. |
executeQueries | public boolean executeQueries(String[] args)(Code) | | Returns true if all of the sample methods returned true
(i.e., their query expressions returned results).
Parameters: args - An array in which the first item is apath to the XML instance file. true if all of the sample methods returned true(i.e., their query expressions returned results); otherwise, false . |
main | public static void main(String[] args) throws org.apache.xmlbeans.XmlException, java.io.IOException(Code) | | Receives an employees list XML instance, passing the instance to
methods that execute queries against it.
Parameters: args - An array in which the first item is apath to the XML instance file. |
parseXml | public XmlObject parseXml(String xmlFilePath)(Code) | | Creates a File from the XML path provided in main arguments, then
parses the file's contents into a type generated from schema.
Parameters: xmlFilePath - A path to XML based on the schema in inventory.xsd. An instance of a generated schema type that contains the parsedXML. |
|
|