# XmlValue

`

###

    import com.sleepycat.dbxml.*;

    public class XmlValue extends Object
    {
    	XmlValue(int flags)
    		throws DbException;
    	...
    }

# Description

An XmlValue is the value of a node in an XML document.

The value types Db.XmlValue::BOOLEAN, Db.XmlValue::NUMBER, and Db.XmlValue::STRING are defined in the W3C XPath 1.0 specification. This implementation adds the value types Db.XmlValue::DOCUMENT, Db.XmlValue::NODELIST, and Db.XmlValue::VARIABLE.

The query context is passed though each of the XmlValue methods as the value of an XmlValue object of type Variable is taken from the context. If no context is provided and a lookup is performed then XmlException::NO_VARIABLE_BINDING will be thrown. This exception is also thrown if a context is provided, but a value is not bound to the variable referred to in the XmlValue object.

DOM_NodeList asNodeList (const XmlQueryContext *context) const
  Return the value as a NodeList.
XmlDocument asDocument (const XmlQueryContext *context) const
  Return the value as a Document.
XmlValue::Type getType (const XmlQueryContext *context) const
  Return the type of the value.
bool asBoolean (const XmlQueryContext *context) const
  Return the value as a Boolean.
bool equals (const XmlValue &v, const XmlQueryContext *context) const
  Compare two values for equality.
bool isBoolean (const XmlQueryContext *context) const
  Return if the value is a Boolean.
bool isDocument (const XmlQueryContext *context) const
  Return if the value is a Document.
bool isNull () const
  Return if the value has no value.
bool isNumber (const XmlQueryContext *context) const
  Return if the value is a Number.
bool isString (const XmlQueryContext *context) const
  Return if the value is a String.
bool isVariable (const XmlQueryContext *context) const
  Return if the value is a Variable.
double asNumber (const XmlQueryContext *context) const
  Return the value as a Number.
isNodeList (const XmlQueryContext *context) const
  Return if the value is a NodeList.
std::string asString (const XmlQueryContext *context) const
  Return the value as a String.

# Class

XmlContainer, XmlDocument, XmlQueryContext

# See Also

XmlContainer.close, XmlContainer.declareIndex, XmlContainer.deleteDocument, XmlContainer.getDocument, XmlContainer.getName, XmlContainer.open, XmlContainer.putDocument and XmlContainer.queryWithXPath.

XmlDocument.getAttributeValue, XmlDocument.getContent, XmlDocument.getID, XmlDocument.getName, XmlDocument.getType, XmlDocument.setContent, XmlDocument.setName, and XmlDocument.setType.

`

Copyright Sleepycat Software