Xml.XMLDoc.TXMLNode.GetAttribute

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetAttribute(const AttrName: DOMString): OleVariant;

C++

System::OleVariant __fastcall GetAttribute(const System::UnicodeString AttrName);

Properties

Type Visibility Source Unit Parent
function protected
Xml.XMLDoc.pas
Xml.XMLDoc.hpp
Xml.XMLDoc TXMLNode

Description

Returns the value of one of this node's attributes.

Use the TXMLNode object's IXMLNode interface to call the protected GetAttribute method. GetAttribute returns the value of an attribute of this node.

AttrName is the name of the attribute.

GetAttribute returns the value of the specified attribute. Typically, this value is a string. If the node does not have an attribute with the name specified by AttrName, the value that GetAttribute returns is determined by the document's Options property. When Options include doAttrNull, GetAttribute returns a Null Variant for missing attributes. When Options does not include doAttrNull, GetAttribute returns an empty string as the value of missing attributes.

If this node is not an element node, GetAttribute raises an EXMLDocError exception.

See Also