Xml.XMLIntf.IXMLNode.AttributeNodes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property AttributeNodes: IXMLNodeList read GetAttributeNodes;

C++

__property _di_IXMLNodeList AttributeNodes = {read=GetAttributeNodes};

Properties

Type Visibility Source Unit Parent
property public
Xml.XMLIntf.pas
Xml.XMLIntf.hpp
Xml.XMLIntf IXMLNode

Description

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

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.

See Also