xmlNamedChild()
This function allows you to easily find a child node in an xml document.
Synopsis
int xmlNamedChild(unsigned doc, string name[, unsigned node]);
Parameters
Parameter | Description |
---|---|
doc | The document ID returned by e.g. xmlNewDocument(). |
name | Name of the child node. |
node |
Optional parameter. The node whose child node ID will be returned. If the node argument is not given, it returns the root node of the tree. |
Return value
It returns the first direct child node (not recursive).
It returns -1 if this node does not exist.
Description
This function allows you to easily find a child node in an xml document, when the node exists but the order of the siblings is unknown. This avoids having to manually browse through all children to find the correct one.
The optional argument tells where to start with the search. When not given, it starts at the document root node
Assignment
Availability
CTRL.
In every script where the "CtrlXml" extension (#uses "CtrlXml") is used.