Microsoft XML SDK 2.6 - XML Reference

nodeFromID Method

Returns the node whose ID attribute matches the supplied value.

objXMLDOMNode = oXMLDOMDocument.nodeFromID(idString)

Parameters

idString
String containing the value of the ID to match.

Return Value

Object. Returns the node that matches the supplied ID. If no nodes match, returns 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, similar to the all collection in DHTML.

To reference a node with nodefromID, the node must by typed as ID in the schema or DTD—simply naming an attribute "ID" doesn't set its data type.

This member is an extension of the W3C DOM.

See Also

Applies To: DOMDocument Object