RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TXMLNode.GetChildValue Method

Returns the value of a specified child node.

Pascal
function GetChildValue(const IndexOrName: OleVariant): OleVariant;
C++
__fastcall OleVariant GetChildValue(const OleVariant IndexOrName);

Use the TXMLNode object's IXMLNode interface to call the protected GetChildValue method. GetChildValue returns the value of the node. 

IndexOrName identifies the desired child node by either 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, GetChildValue nil (Delphi) or NULL (C++). Otherwise, the return value depends on the type of the child node, as indicated in the following table:

NodeType 
Value 
ntAttribute  
The attribute value  
ntElement  
If the element contains only text, this is that text value. Otherwise, GetChildValue raises an exception.  
ntText  
The text  
ntCData  
The content of the CDATA section.  
ntEntityRef  
nil (Delphi) or NULL (C++)  
ntProcessingInstr  
The content of the processing instruction except for the target.  
ntComment  
The value (text) of the comment.  
ntDocFragment  
nil (Delphi) or NULL (C++)  

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

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