Xml.XMLDoc.TXMLNode.CreateHosted
Delphi
constructor CreateHosted(HostNode: TXMLNode);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
constructor | public | Xml.XMLDoc.pas | Xml.XMLDoc | TXMLNode |
Description
Creates a TXMLNode instance that represents the same DOM node as another "host" node.
CreateHosted instantiates a new TXMLNode object to represent a specific view on an existing TXMLNode object.
HostNode is another TXMLNode object that represents the host node of this node. The new node becomes a "hosted" node, which means it shares the same underlying parent and DOM node as the host node, but represents a different view of the host node. For example, a node that contains some child nodes that are all of the same type creates a hosted node to represent only the set of repeating child nodes.
Typically, applications do not directly call CreateHosted to create a hosted node. Instead, this method is called in code generated by the XML Data Binding Wizard, or by the CreateCollection method of the host node.
HostNode (or, if HostNode is hosted, the host node of HostNode) becomes the value of the new node's HostNode property, and the new node is added to the HostedNodes property list of the new host node.