XmlContainer::updateDocument

#include <DbXml.hpp>

void XmlContainer::updateDocument(XmlDocument &document,
    XmlUpdateContext &context)

void XmlContainer::updateDocument(XmlTransaction &txn,
    XmlDocument &document, XmlUpdateContext &context)

Updates an XmlDocument in the container. The document must have been retrieved from the container using XmlContainer::getDocument, XmlManager::query, or XmlQueryExpression::execute. It is possible to use a constructed XmlDocument object, if its name is set to a valid name in the container. The document must still exist within the container. The document content is indexed according to the container indexing specification, with index keys being removed for the previous document content, and added for the updated document content.

Parameters

txn

If the operation is to be transaction-protected, the txn parameter is an XmlTransaction handle returned from XmlManager::createTransaction.

document

The XmlDocument to be updated in the XmlContainer.

context

The update context to use for the document insertion.

Errors

The XmlContainer::updateDocument 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::getDbErrno method will return the error code for the error.

DOCUMENT_NOT_FOUND

The specified document is not in the XmlContainer.

INDEXER_PARSER_ERROR

The XML Indexer could not parse the document.

Class

XmlContainer

See Also

XmlContainer Methods