### XmlContainer.setIndexSpecification |

`

###

    import com.sleepycat.dbxml.*;

    public void setIndexSpecification(DbTxn txn,
        XmlIndexSpecification index)
        throws XmlException;

### Description: XmlContainer.setIndexSpecification

The XmlContainer.setIndexSpecification method defines the type of indexing to be maintained for a container of documents. The currently defined indexing specification can be retrieved with the XmlContainer.getIndexSpecification method.

If the container is not empty then the contained documents are incrementally indexed. Index keys for disabled index strategies are removed and index keys for enabled index strategies are added. Note that the length of time taken to perform this re-indexing operation is proportional to the size of the container.

The application must open the container before attempting to modify its indexing specification.

### Parameters

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

index
  The indexing specification for the container.

### Throws

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

CONTAINER_CLOSED
  Indices may only be declared on open containers.

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`

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