RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
IXMLNode.ChildValues Property

Represents the values of this node's child nodes.

Pascal
property ChildValues [const IndexOrName: OleVariant]: OleVariant;
C++
__property OleVariant ChildValues[OleVariant const IndexOrName];

Use ChildValues to access the values of this node's children. 

IndexOrName identifies the desired child node either by its interface, or by a string that is the local name of the child node. If IndexOrName does not identify a child of this node, trying to get or set ChildValues causes an exception. 

The value of a child node depends on the type of the child node, as indicated in the following table:

Value 
ntElement  
If the element contains only text, this is that text value. Otherwise, it is the Value of the first child node.  
ntText  
The text  
ntCData  
The content of the CDATA section.  
ntProcessingInstr  
The content of the processing instruction except for the target.  
ntComment  
The value (text) of the comment.  
If the child node is any other node type, reading or setting ChildValues causes an exception.  
 

Note: In Delphi, ChildValues is the default property for IXMLNode. That means that you can omit the property name when using this property. For example

Edit1.Text := XMLDocument1.DocumentElement.ChildValues['Name'];

can also be written

Edit1.Text := XMLDocument1.DocumentElement['Name'];

Note: Attributes are not considered child nodes of a node. To get or set the values of this node's attributes, use the Attributes property instead.
 

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