RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TXMLNode.Collection Property

Indicates the collection in which this node appears.

Pascal
property Collection: TXMLNodeCollection;
C++
__property TXMLNodeCollection Collection;

Collection indicates the collection that contains this node if it represents one of a repeating set of child nodes. The node specified by Collection represents the same node in the XML document as this node's ParentNode property, but it is specialized to work with this node and any other child nodes of the same type.  

The node identified by Collection is one of the collections listed by the parent node's HostedNodes property, and it lists ParentNode as the value of its HostNode property. 

For example, consider the following XML fragment:

<students>
  <student name="John Smith">
    <grade>incomplete</grade>
  </student>
  <student name="Jane Doe">
    <grade>B+</grade>
  </student>
  <auditor name="Bill Jones"></auditor>
</students>

If this node represents one of the <student> nodes, then ParentNode represents the <students> node, and Collection represents a copy of the <students> node that is used for only those children that are <student> nodes, and not the <auditor> nodes. 

Applications can't use this protected property to access the Collection that contains this node. Instead, they use the Collection property of the IXMLNode interface for this node. 

 

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