Microsoft XML SDK 2.6 - XML Reference

IXMLDOMNode::nodeTypedValue Method

IXMLDOMNode::get_nodeTypedValue Method

Contains this node's value, expressed in its defined data type.

Visual Basic Syntax

strValue = oXMLDOMNode.nodeTypedValue

C/C++ Syntax

HRESULT get_nodeTypedValue(
    VARIANT *typedValue);

Parameters

typedValue [out]
Value of this node in its defined data type, if such a data type is defined. If this node has no content, the value of typedValue is Null.

C/C++ Return Values

S_OK
Value returned if successful.
E_INVALIDARG
Value returned if typedValue is Null.

Data Type Mapping

VARIANT returned Corresponding element data type
VT_BSTR string
VT_BSTR number
VT_I4 int
VT_CY fixed.14.4
VT_BOOL boolean
VT_DATE dateTime
VT_DATE dateTime.tz
VT_DATE date
VT_DATE time
VT_DATE time.tz
VT_I1 i1 byte
VT_I2 i2
VT_I4 i4, int
VT_UI1 ui1
VT_UI2 ui2
VT_UI4 ui4
VT_FLOAT r4
VT_DOUBLE r8, float
VT_BSTR uuid
VT_ARRAY bin.hex
VT_ARRAY bin.base64


IXMLDOMNode::put_nodeTypedValue Method

Contains this node's value, expressed in its defined data type.

Visual Basic Syntax

objXMLDOMNode.nodeTypedValue = strValue

C/C++ Syntax

HRESULT put_nodeTypedValue(
    VARIANT typedValue);

Parameters

typedValue [out]
Value of this node in its defined data type, if such a data type is defined.

C/C++ Return Values

S_OK
Value returned if successful.
E_INVALIDARG
Value returned if typedValue is Null.
E_FAIL
Value returned if an error occurs.

Remarks

This value depends on the value of the IXMLDOMNode interface's nodeType method.

NODE_ATTRIBUTE Returns the value in the data representation of the type specified in the schema for the attribute. (Data types are specified using the dt:dt attribute, and because attributes cannot be applied to attributes, the attribute's data type can be specified only in the schema.) If no type is specified, it returns a string identical to the nodeValue method. If the new value is not of the type specified in the schema or cannot be coerced to the type specified in the schema, an error occurs.
NODE_CDATA_SECTION, NODE_COMMENT, NODE_DOCUMENT, NODE_DOCUMENT_FRAGMENT, NODE_DOCUMENT_TYPE, NODE_ENTITY, NODE_NOTATION, NODE_PROCESSING_INSTRUCTION Returns a string that is equal to the nodeValue method. These node types do not have data types.
NODE_ELEMENT Returns the value in the data representation of the type specified on the element instance (using the dt:dt attribute) or specified in the schema. If no type is specified on the instance or in the schema, it returns a string identical to the nodeValue method. If the element has an attribute data type, it returns Null.
NODE_ENTITY_REFERENCE Returns the value in the data representation of the type specified for the referenced entity. This is limited to entities with a single data type on the root level element of the subtree corresponding to the entity. If no data type is specified, it returns a string identical to the nodeValue method.
NODE_TEXT Returns the value in the data representation of the type of the containing element. If the containing element is not typed, it returns a string identical to the nodeValue method.

The data type for this node is defined in its dataType method. This method also depends on the value of the node type, in the nodeType method.

Although you can explicitly set the nodeTypedValue method with a particular data type in the VARIANT, the set operation does not change the data type. The value in the VARIANT is coerced to the data type specified in the dataType method, and the set operation returns an error if the type coercion is not possible.

Changes to this method are also immediately available from the nodeValue method.

See Also

IXMLDOMNode Interface