XmlContainer::deleteDocument

#include <DbXml.hpp>

void XmlContainer::deleteDocument(const std::string name, 
    XmlUpdateContext &context)

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

void XmlContainer::deleteDocument(XmlTransaction &txn, 
    const std::string name, XmlUpdateContext &context)

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

The XmlContainer::deleteDocument method removes the specified XmlDocument from the XmlContainer .

You can specify the document by name, or as a reference to an XmlDocument object.

Deleting document by name

#include <DbXml.hpp>

void XmlContainer::deleteDocument(const std::string name, 
    XmlUpdateContext &context)

void XmlContainer::deleteDocument(XmlTransaction &txn, 
    const std::string name, XmlUpdateContext &context) 

Delete the document with the given name. Parameters are:

txn

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

name

The name of the XmlDocument to be deleted from the container.

context

The XmlUpdateContext object to use for this deletion.

Deleting document by XmlDocument object

#include <DbXml.hpp>

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

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

Removes the specified XmlDocument from the XmlContainer .

txn

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

document

The XmlDocument to be deleted from the container. The name of the document to be deleted is extracted from this parameter.

context

The XmlUpdateContext object to use for this deletion.

Errors

The XmlContainer::deleteDocument 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 .

Class

XmlContainer

See Also

XmlContainer Methods