次の方法で共有


nodeFromID Method (Windows Embedded CE 6.0)

1/6/2010

Returns the node that matches the ID attribute.

Script Syntax

var objXMLDOMNode = oXMLDOMDocument.nodeFromID(idString);

Remarks

Ee503389.collapse(en-US,WinEmbedded.60).gifScript Parameters

  • idString
    String containing the value of the ID to match.

Ee503389.collapse(en-US,WinEmbedded.60).gifScript Return Value

Object. Returns the node that matches the supplied ID. If no nodes match, returns Null.

Ee503389.collapse(en-US,WinEmbedded.60).gifC/C++ Syntax

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

Remarks

Ee503389.collapse(en-US,WinEmbedded.60).gifC/C++ Parameters

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

Ee503389.collapse(en-US,WinEmbedded.60).gifC/C++ Return Values

  • S_OK
    Value returned if successful.
  • S_FALSE
    Value returned when there is no node with the given ID.
  • E_INVALIDARG
    Value returned if node is Null.

Ee503389.collapse(en-US,WinEmbedded.60).gifRequirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

General 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.

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

To reference a node with nodefromID, the node must by typed as ID in the schema or document type definition (DTD). Simply naming an attribute "ID" does not set its data type.

This member is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

This method applies to the following interface:

DOMDocument

See Also

Reference

XML DOM Methods