RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
IXMLNode.AttributeNodes Property

Lists the interfaces for nodes that represent attributes of this node.

Pascal
property AttributeNodes: IXMLNodeList;
C++
__property IXMLNodeList AttributeNodes;

Use AttributeNodes to access the attributes of this node using an IXMLNode interface. Attributes modify a node in an XML document. For example, given the node for

<Movie genre="scifi" title="Star Wars"> ... </Movie>

both genre and title are attributes of the node, with values of "scifi" and "Star Wars", respectively. 

If an attribute consists of a simple Name=Value pair, it is simpler to use the Attributes property to read or set attribute values. AttributeNodes is an IXMLNodeList interface, which can be used to  

Read the count of attributes before iterating over all the attributes of this node. 

Add or delete attribute nodes from this node. 

Access attributes through an XML node interface (for example, to read the attribute names from the nodes). 

Only element nodes have attributes, and not every element node has them. If the node does not have any attributes, AttributeNodes is the interface for an empty list.

Note: Attributes are not considered child nodes of a node and can't be accessed using the ChildNodes property.
 

 

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