XmlContainer.putDocument

API Ref

import com.sleepycat.dbxml.*;

public int putDocument(DbTxn txn, XmlDocument document, XmlUpdateContext context, int flags) throws XmlException;


Description: XmlContainer.putDocument

The XmlContainer.putDocument method inserts a XmlDocument into the container, and returns the system-assigned document ID, as a 32-bit unsigned integral value. The document content is indexed according to the container indexing specification. The indexer supports the Xerces content encodings and expects the content to be well-formed, but it need not be valid.

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
(Optional) The update context within which the document is to be added. The context provides a performance improvement by caching objects that can be reused for multiple operations.

flags
Not currently used.

The id of the document.

Throws

The XmlContainer.putDocument 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.

INDEXER_PARSER_ERROR
The XML Indexer could not parse the document.

Class

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

APIRef

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