revXMLNumberOfChildren |
Type | function |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | revXMLNumberOfChildren(<treeID>, <startNode>, <childName> [, <depth>])
|
Associations | xml library |
Summary | Returns the number of child nodes under the
specified node in an XML tree.
|
Introduced | 2.0 |
OS | mac, windows, linux, ios, android |
Platforms | desktop, server, mobile |
Parameters | Name | Type | Description |
---|
treeID | | The number returned by the revXMLCreateTree or revXMLCreateTreeFromFile
function when you created the XML tree.
|
startNode | | The path to the node whose child nodes you want to count.
|
childName | | A string specifying which child nodes to count. If it is empty, all
child nodes are counted. Otherwise, only child nodes whose name matches
the childName are counted.
|
depth | | The depth specifies how many generations to count. If you specify 0,
only the parentNode's direct child nodes are counted, but not their
child nodes. If you specify 1, the parentNode's child nodes are counted,
along with their child nodes. To count all generations, specify -1 as
the depth.
|
|
Example | revXMLNumberOfChildren(3,myNode,,-1)
repeat for revXMLNumberOfChildren(theTree,theNode,"Book",1) times
|
Values | |
Related | Keyword: integer
Control Structure: function
Function: revXMLChildContents, revXMLFirstChild, revXMLChildNames
Library: XML library
Glossary: LiveCode custom library, return, XML tree, child node, Standalone Application Settings, standalone application, non-negative, node, parent node
|
Security | disk |
Description | Use the revXMLNumberOfChildren function to find out how many child
node|child nodes a parent node has, or to find out how many of a
particular kind of child nodes it has.
If the revXMLNumberOfChildren function encounters an error, it
returns an error message starting with "xmlerr".
Important: The revXMLNumberOfChildren function is part of the
XML library. To ensure that the function works in a
standalone application, you must include this
custom library when you create your
standalone. In the Inclusions pane of the
Standalone Application Settings window, make sure the "XML"
checkbox is checked.
|
Tags | text processing |