XmlContainer::parseXPathExpression

API Ref

#include <DbXml.hpp>

XmlQueryExpression XmlContainer::parseXPathExpression( DbTxn *txn, const std::string &xpath, XmlQueryContext *context=0);


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::txn_begin, 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.

Errors

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

APIRef

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