RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TXMLNode.GetAttribute Method

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

Pascal
function GetAttribute(const AttrName: DOMString): OleVariant;
C++
__fastcall OleVariant GetAttribute(const DOMString AttrName);

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. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!