revXMLMatchingNode |
Type | function |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | revXMLMatchingNode(<treeID>, <startNode>, <childName>, <attributeName>, <attributeValue>, <depth> [, <caseSensitive>])
|
Associations | xml library |
Summary | Finds the node in an XML tree where the specified attribute of the
node has the specified value.
|
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 where you want to start.
|
childName | | A string specifying which child nodes to scan. If it is empty, all child
nodes are scanned. Otherwise, only child nodes whose name matches the
childName are scanned.
|
attributeName | | The name of the attribute you want to examine.
|
attributeValue | | The value that the attributeName must have to be found.
|
depth | | The depth specifies how many generations to scan. If you specify 1, the
parentNode's child nodes are scanned, but not their child nodes. To scan
all generations, specify -1 as the depth.
|
caseSensitive | | True or false and determines whether the attributeValue should be
compared in a case-sensitive manner or not. If caseSensitive is not
specified, then case is ignored when comparing attribute values (i.e.
defaults to false).
|
|
Example | revXMLMatchingNode(1,revXMLRootNode(1),,"PubYear","2001",-1)
put revXMLMatchingNode(thisTree,it,field "Category",thisAttr,"Yes",4) after tFoundNodePaths
|
Values | Name | Type | Description |
---|
return | | The revXMLMatchingNode function returns a string consisting of the
path to the first node containing the specified attribute with the
specified value.
|
|
Related | Control Structure: function
Function: revXMLAttributeValues, revXMLChildNames, revXMLTree, revXMLAttributes
Glossary: LiveCode custom library, node, Standalone Application Settings, standalone application, XML tree, return, attribute
Library: XML library
|
Security | disk |
Description | Use the revXMLMatchingNode function to search for a node by its
attributes.
If the revXMLMatchingNode function encounters an error, it
returns an error message starting with "xmlerr".
Important: The revXMLMatchingNode 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 |