| java.lang.Object org.apache.xmlbeans.samples.xquery.ExecQuery
ExecQuery | public class ExecQuery (Code) | | This class demonstrates how to use the execQuery method to execute XQuery
expressions. Compare the code here with the code in the SelectPath class.
That class uses the selectPath method to execute XPath expressions.
You can call the execQuery method from either an XmlObject or XmlCursor
instance. Calling from XmlObject returns an XmlObject array. Calling
from XmlCursor returns a new XmlCursor instance positioned at the root
of a fragment containing copies of the XML queried against. Results of the
query (if any) are sibling children of the fragment's root.
|
Method Summary | |
public boolean | collectZips(XmlObject empDoc) Uses XQuery to retrieve work elements from the incoming XML, adding the
elements as children to a element.
This method demonstrates the following characteristics of the execQuery method:
- it supports XQuery.
- execQuery called from an XmlObject returns an array of XmlObject instances.
These are bound to copies of the received XML.
Parameters: empDoc - The incoming XML. | public boolean | updateWorkPhone(XmlObject empDoc) Uses XQuery to retrieve work elements from the incoming XML, then
changes the number in the results.
This method demonstrates the following characteristics of the execQuery method:
- it supports XQuery.
- the XML it returns is a copy of the XML queried against; contrast this with
the selectPath method, which returns a portion of the original document.
Changes to returned XML do not impact the XML queried against. |
m_namespaceDeclaration | final static String m_namespaceDeclaration(Code) | | |
collectZips | public boolean collectZips(XmlObject empDoc)(Code) | | Uses XQuery to retrieve work elements from the incoming XML, adding the
elements as children to a element.
This method demonstrates the following characteristics of the execQuery method:
- it supports XQuery.
- execQuery called from an XmlObject returns an array of XmlObject instances.
These are bound to copies of the received XML.
Parameters: empDoc - The incoming XML. true if the XPath expression returned results;otherwise, false . |
updateWorkPhone | public boolean updateWorkPhone(XmlObject empDoc)(Code) | | Uses XQuery to retrieve work elements from the incoming XML, then
changes the number in the results.
This method demonstrates the following characteristics of the execQuery method:
- it supports XQuery.
- the XML it returns is a copy of the XML queried against; contrast this with
the selectPath method, which returns a portion of the original document.
Changes to returned XML do not impact the XML queried against.
- execQuery called from an XmlCursor returns a cursor positioned at
the STARTDOC token of a new XML fragment. Contrast this with the
XmlCursor.selectPath method, which stores results as "selections" in
the cursor used to execute the query.
Parameters: empDoc - The incoming XML. true if the XPath expression returned results;otherwise, false . |
|
|