Microsoft XML SDK 2.6 - XML Reference

IXMLDOMNode::firstChild Method

IXMLDOMNode::get_firstChild Method

Contains the first child of this node.

Visual Basic Syntax

Set objXMLDOMNode = oXMLDOMNode.firstChild

C/C++ Syntax

HRESULT get_firstChild(
    IXMLDOMNode **firstChild);

Parameters

firstChild [out]
First child node. If there are no such children, it returns Null.

C/C++ Return Values

S_OK
Value returned if successful.
S_FALSE
Value returned when there are no children.
E_INVALIDARG
Value returned if firstChild is Null.

Remarks

This value depends on the value of the nodeType method.

NODE_ATTRIBUTE, NODE_DOCUMENT, NODE_DOCUMENT_FRAGMENT, NODE_DOCUMENT_TYPE, NODE_ELEMENT, NODE_ENTITY, NODE_ENTITY_REFERENCE Returns the first child node. If there are no children, returns Null.
NODE_CDATA_SECTION, NODE_COMMENT, NODE_NOTATION, NODE_PROCESSING_INSTRUCTION, NODE_TEXT Returns Null. These node types cannot have children.

See Also

IXMLDOMNode Interface