Microsoft XML SDK 2.6 - XML Reference

IXMLDOMNode::nodeValue Method

IXMLDOMNode::get_nodeValue Method

Contains the text associated with the node.

Visual Basic Syntax

strValue = oXMLDOMNode.nodeValue

C/C++ Syntax

HRESULT get_nodeValue(
    VARIANT *value);

Parameters

value [out]
Node value; depends on the nodeType method.

C/C++ Return Values

S_OK
Value returned if successful.
S_FALSE
Value when returning Null.
E_INVALIDARG
Value returned if value is Null.
E_FAIL
Value returned if an error occurs.


IXMLDOMNode::put_nodeValue Method

Contains the text associated with the node.

Visual Basic Syntax

objXMLDOMNode.nodeValue = strValue

C/C++ Syntax

HRESULT put_nodeValue(
    VARIANT value);

Parameters

value [in]
Node value; depends on the nodeType method.

C/C++ Return Values

Returns S_OK if successful, or an error code otherwise.

Remarks

This value depends on the value of the nodeType method.

NODE_ATTRIBUTE A string representing the value of the attribute. For attributes with subnodes, this is the concatenated text of all subnodes with entities expanded. Setting this value deletes all children of the node and replaces them with a single text node containing the value written.
NODE_CDATA_SECTION A string representing the text stored in the CDATA section.
NODE_COMMENT The content of the comment, exclusive of the comment start and end sequence.
NODE_DOCUMENT, NODE_DOCUMENT_TYPE, NODE_DOCUMENT_FRAGMENT, NODE_ELEMENT, NODE_ENTITY, NODE_ENTITY_REFERENCE, NODE_NOTATION Null. Note also that attempting to set the value of the node returns an error.
NODE_PROCESSING_INSTRUCTION The content of the processing instruction, excluding the target. (The target appears in the nodeName method.)
NODE_TEXT A string representing the text stored in the text node.

The new value is also available from the nodeType method.

See Also

IXMLDOMNode Interface