### XmlContainer.updateDocument |

`

###

    import com.sleepycat.dbxml.*;

    public void updateDocument(DbTxn txn, XmlDocument document, XmlUpdateContext context)
        throws XmlException;

### Description: XmlContainer.updateDocument

The XmlContainer.updateDocument method updates a XmlDocument in the container. The document must have been retrieved from the container using the XmlContainer.getDocument or XmlContainer.queryWithXPath methods, and 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 a transaction handle returned from DbEnv.txnBegin, otherwise, NULL.

document
  The XmlDocument to be inserted into the XmlContainer.

context
  The optional XmlUpdateContext object provides a performance improvement by caching internal objects over multiple calls to the container update methods.

### Throws

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

CONTAINER_CLOSED
  The container is closed.

DATABASE_ERROR
  An error occurred in an underlying Berkeley DB database. The XmlException.getDbError 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, XmlDocument, XmlException, XmlIndexSpecification, XmlQueryContext, XmlQueryExpression, XmlResults, XmlUpdateContext, XmlValue`

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