Share via


getAttribute Method

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Retrieves the value of the attribute.

Script Syntax

            objValue = oXMLDOMElement.getAttribute(name);

Remarks

Script Parameters

  • name
    String specifying the name of the attribute to return.

Script Return Value

Variant. Returns a string that contains the attribute value or returns the empty string if the named attribute does not have a specified or default value.

C/C++ Syntax

HRESULT getAttribute(
  BSTR name,
  VARIANT* value
);

Remarks

C/C++ Parameters

  • name
    [in] Name of the attribute to return.
  • value
    [out, retval] String that contains the attribute value. The empty string is returned if the named attribute does not have a specified or default value.

C/C++ Return Values

  • S_OK
    Value returned if successful.
  • S_FALSE
    Value when no attribute with the given name is found.
  • E_INVALIDARG
    Value returned if name is Null.

Requirements

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

General Remarks

You can also retrieve attributes by using the getNamedItem Method of the IXMLDOMNamedNodeMap.

This method applies to the following objects and interfaces:

IXMLDOMElement and IXMLDOMNamedNodeMap.

See Also

Concepts

getNamedItem Method