Method XmlNode():getChild() Foundation

Gets a child node by name or ordinal.

:getChild( <nOrdinal> [,<cNS>] ) --> oChild | NIL
:getChild( <cName> [,<cNS>]) --> oChild | NIL
A numeric value with the ordinal position of the desired node in the child list.
An character string with the name of the child node to be returned. The node name must be specified as a local name, that is, as the node name without a namespace qualifier.
A character string with the namespace the child belongs to. The <cNS> parameter is optional. It can be used to distinguish between childs which belong to different namespaces.

An XmlNode() object representing the child node specified in the parameter <cName> or <nOrdinal>. If no child node exists with the specified name, or if the ordinal position is out of range, the method returns NIL.


The method :getChild() returns a specific child node which can be specified either by name, or by ordinal position. Note that if a node name is specified in the <cName> parameter and several child nodes exist with this name, only the first node is returned by :getChild(). In this case, the search may optionally be qualified further by using the <cNS> parameter to specify the namespace the child belongs to. Use the method :getChilds() for retrieving multiple child nodes.

The node name specified in <cName> is case-insensitive. This behavior is Xbase++-specific. Although it does not conform to the XML standard, the case-insensitive behavior is in line with how names and symbols are treated in the Xbase++ language.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.