RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TXMLNode.HostNode Property

Indicates the main object for the node to which this node corresponds when it represents a specialized view.

Pascal
property HostNode: TXMLNode;
C++
__property TXMLNode HostNode;

If this node represents a hosted node, HostNode is the main node for which this node represents a subset or specialized view. For example, if this node represents a set of repeating child elements, HostNode is the node that uses this node to represent its repeating child elements.  

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>
  <auditor name="Susan Brown"></auditor>
</students>

The <students> node spawns two hosted nodes to represent the collections of repeating child nodes: one for all of the child nodes of type <student>, and one for all of the child nodes of type <auditor>. If this node represents one of those hosted nodes, then HostNode is the <students> node to which this node belongs. The host node lists this node in its HostedNodes property. 

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

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!