XmlContainer::addIndex

API Ref

#include <DbXml.hpp>

void XmlContainer::addIndex( DbTxn *txn, const std::string &uri, const std::string &name, const std::string &index);


Description: XmlContainer::addIndex

The XmlContainer::addIndex method adds an index of the specified type for the named document node. This method is for convenience - see XmlIndexSpecification::addIndex for more information.

Parameters

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

uri
The namespace of the node to be indexed. The default namespace is selected by passing an empty string for the namespace.

name
The name of the element or attribute node to be indexed.

index
A space-separated list of the following indexing strategy names:

  • none-none-none-none
  • node-element-presence-none
  • node-attribute-presence-none
  • node-element-equality-string
  • node-element-equality-number
  • node-element-substring-string
  • node-attribute-equality-string
  • node-attribute-equality-number
  • node-attribute-substring-string
  • edge-element-presence-none
  • edge-attribute-presence-none
  • edge-element-equality-string
  • edge-element-equality-number
  • edge-element-substring-string
  • edge-attribute-equality-string
  • edge-attribute-equality-number
  • edge-attribute-substring-string

Errors

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

DATABASE_ERROR
An error occurred in an underlying Berkeley DB database. The XmlException::getDbError method will return the error code for the error.

Class

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

APIRef

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