Home » xmlbeans-2.5.0-src » org.apache.xmlbeans.samples » xquery » [javadoc | source]
org.apache.xmlbeans.samples.xquery
public class: XQueryXPath [javadoc | source]
java.lang.Object
   org.apache.xmlbeans.samples.xquery.XQueryXPath
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 from org.apache.xmlbeans.samples.xquery.XQueryXPath Summary:
executeQueries,   main,   parseXml
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xmlbeans.samples.xquery.XQueryXPath Detail:
 public boolean executeQueries(String[] args) 
    Returns true if all of the sample methods returned true (i.e., their query expressions returned results).
 public static  void main(String[] args) throws XmlException, IOException 
    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.