XmlContainer.queryWithXPath |
![]() ![]() |
import com.sleepycat.dbxml.*;public XmlResults queryWithXPath(DbTxn txnid, XPathExpression expression, int flags) throws XmlException;
public XmlResults queryWithXPath(DbTxn txnid, String query, XmlQueryContext context, int flags) throws XmlException;
Return the results of an XPath 1.0 version query against the container. In the first variant, expression is provided as the results of a call to the XmlContainer.parseXPathExpression method.
In the second variant, query is provided as a string (expected to be in the syntax defined in the W3C XPath 1.0 specification). In this case, the query may optionally be done within the execution context context, which describes how the query is to be performed. If no context is specified, the query will retrieve the set of XmlDocuments matching the XPath expression.
If the operation is to be transaction-protected, the txnid parameter is a transaction handle returned from DbEnv.txn_begin; otherwise, null.
The flags value must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
Because the XmlContainer.getDocument interface will not hold locks across Berkeley DB interface calls in non-transactional environments, the Db.DB_RMW flag to the XmlContainer.getDocument call is meaningful only in the presence of transactions.
The XmlContainer.queryWithXPath method throws an exception that encapsulates a non-zero error value on failure.
The XmlContainer.queryWithXPath method may fail and throw an exception encapsulating a non-zero error for the following conditions:
The XmlContainer.queryWithXPath method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the XmlContainer.queryWithXPath method may fail and throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way.
XmlDocument.getAttributeValue, XmlDocument.getContent, XmlDocument.getID, XmlDocument.getName, XmlDocument.getType, XmlDocument.setContent, XmlDocument.setName, and XmlDocument.setType.
![]() ![]() |