### XmlContainer.parseXPathExpression |

`

###

    import com.sleepycat.dbxml.*;

    public XmlQueryExpression parseXPathExpression(
        DbTxn txn, String query, XmlQueryContext context)
        throws XmlException;

### Description: XmlContainer.parseXPathExpression

The XmlContainer.parseXPathExpression returns a pre-parsed XPath expression, which can be used with the XmlContainer.queryWithXPath method.

The query may optionally be parsed within an XmlQueryContext, which describes how the query is to be performed. If no context is specified the default context is used. The default query context defines the namespace prefix "dbxml", contains no variable bindings, specifies eager evaluation, and specifies that the method should return the set of XmlDocuments matching the XPath expression.

### Parameters

txn
  If the operation is to be transaction-protected, the txn parameter is a transaction handle returned from DbEnv.txnBegin, otherwise, NULL.

query
  The XPath expression is provided as a string and must conform to the syntax defined in the W3C XPath 1.0 specification.

context
  The context within which the query is to be performed. The context contains the variable bindings, the namespace prefix to URI mapping, and the query processing flags.

Returns a pre-parsed XPath expression.

### Throws

The XmlContainer.close method may fail and throw XmlException, encapsulating one of the following non-zero errors:

CONTAINER_CLOSED
  The container is closed.

XPATH_PARSER_ERROR
  The XPath parser could not parse the XPath expression.

### Class

XmlContainer, XmlDocument, XmlException, XmlIndexSpecification, XmlQueryContext, XmlQueryExpression, XmlResults, XmlUpdateContext, XmlValue`

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.