Berkeley DB: XmlValue
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

# XmlValue |

`

###

    #include <DbXml.hpp>

    class DbXml::XmlValue {
    public:
    	XmlValue ()
    	XmlValue (const std::string &v)
    	XmlValue (const char *v)
    	XmlValue (double v)
    	XmlValue (bool v)
    	XmlValue (XmlDocument &v)
    	XmlValue (DOM_NodeList &v)
    	XmlValue (Type type, const std::string &v)
    	virtual ~XmlValue ()
    	XmlValue (const XmlValue &)
    	XmlValue & operator= (const XmlValue &)
    	...
    };

# Description

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

The value types XmlValue::BOOLEAN, XmlValue::NUMBER, and XmlValue::STRING are defined in the W3C XPath 1.0 specification. This implementation adds the value types XmlValue::DOCUMENT, XmlValue::NODELIST, and 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