RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TXMLNodeCollection Class

TXMLNodeCollection represents a node in an XML document whose children are instances of the same repeating element.

Pascal
TXMLNodeCollection = class(TXMLNode, IXMLNodeCollection);
C++
class TXMLNodeCollection : public TXMLNode, public IXMLNodeCollection;

The XML Data Binding Wizard uses TXMLNodeCollection as a base class for the classes it generates to represent nodes that have repeating elements for child nodes. For example, if the XML document includes the following:

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

then the XML Data Binding Wizard generates 3 nodes to represent the <students> node: a TXMLNode descendant to represent the entire <students> node, and two TXMLNodeCollection descendants to represent the repeating elements: one for the child nodes with the tag <student>, and one for the child nodes with the tag <auditor>. 

As with any of the classes the Data Binding Wizard generates to represent nodes in an XML document, child nodes and node attributes appear as properties of the TXMLNodeCollection descendant. 

TXMLNodeCollection implements the IXMLNodeCollection interface. Each TXMLNodeCollection descendant implements a class-specific interface that descends from IXMLNodeCollection. Typically, applications do not work directly with TXMLNodeCollection. Instead, they use the IXMLNodeCollection interface or the IXMLNodeCollection descendant that is implemented by a TXMLNodeCollection descendant. 

 

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