Click to return to the XML (Extensible Markup Language) home page    
IXMLDOMDocument::loadXML ...     IXMLDOMDocument::ondataav...     IXMLDOMDocument Interface    
Web Workshop  |  XML (Extensible Markup Language)

IXMLDOMDocument::nodeFromID Method


Returns the node whose ID attribute matches the supplied value.

Visual Basic Syntax

Set objXMLDOMNode = oXMLDOMDocument.nodeFromID(idString)

C/C++ Syntax

HRESULT nodeFromID(
    BSTR idString,
    IXMLDOMNode **node);

Parameters

idString
[in] Value of the ID to match.
node
[out] Node that matches the supplied ID. If no nodes match, this method returns NULL.

C/C++ Return Values

S_OK
Value returned if successful.
S_FALSE
Value when returning null. 
E_INVALIDARG
Value returned if node is null.

Remarks

According to the XML 1.0 Recommendation (REC-xml-19980210), ID attribute values must be unique within their XML documents, and no element can specify more than one ID attribute.

This method was designed to handle ID/IDREF relationships in XML, but does not require an attribute of type IDREF. It can be used generically in a way similar to the all collection in DHTML.

This member is an extension of the W3C DOM.



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.