Xml.XMLIntf.IXMLNode.ChildValues

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ChildValues[const IndexOrName: OleVariant]: OleVariant read GetChildValue write SetChildValue; default;

C++

__property System::OleVariant ChildValues[const System::OleVariant IndexOrName] = {read=GetChildValue, write=SetChildValue/*, default*/};

Properties

Type Visibility Source Unit Parent
property public
Xml.XMLIntf.pas
Xml.XMLIntf.hpp
Xml.XMLIntf IXMLNode

Description

Represents the values of this node's child nodes.

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:



NodeType 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.

See Also