### XmlDocument.setMetaData |

`

###

    import com.sleepycat.dbxml.*;

    public void setMetaData(String uri, String prefix, String name, XmlValue value)
        throws XmlException;

### Description: XmlDocument.setMetaData

The XmlDocument.setMetaData method sets the value of the specified metadata attribute. A metadata attribute is a name-value pair, which is stored with the document, but not as part of the document content.

A metadata attribute name consists of three parts; a namespace URI, a namespace prefix, and a local name. The namespace URI and prefix are optional, but should be used to avoid naming collisions.

Typed values are passed to the API as an instance of XmlValue, and may be of type Number, String, or Boolean. The system reflects each typed metadata attribute into the document by adding a namespace declaration attribute and metadata attribute to the document root element. The following example associates a metadata attribute with a document:

XmlDocument document; document.setContent("<x/>"); document.setMetaData("http://acme.com/", "acme", "received", new XmlValue("1-Jan-2002"));

The system reflects the metadata attribute into the document as follows:

<x xmlns:acme= 'http://acme.com/' acme:received= '1-Jan-2002'/>

The metadata attribute can be queried using the XPath expression:

>     /*[@acme:received= '1-Jan-2002'].

### Parameters

uri
  The namespace within which the name resides. The empty string refers to the default namespace.

prefix
  The prefix for the namespace.

name
  The name of the metadata attribute.

value
  A Number, String, or Boolean value.

### Class

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

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