revXMLAttributeValues

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
revXMLAttributeValues(<treeID>, <startNode>, <childName>, <attributeName>, <delimiter>, <depth>)
Associationsxml library
Summary

Returns a list of the values of a specified attribute for the specified nodes in an XML tree.

Introduced2.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
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 to scan for.

delimiter

A string that separates each value from the rest.

depth

The depth specifies how many generations of the XML tree to scan. If you specify zero, only the startNode is scanned; if you specify 1, the startNode and its child nodes are scanned, but not their child nodes; and so on. To scan all generations, specify -1 as the depth.

Example
revXMLAttributeValues(2,"/",,"Age",return,-1)
get revXMLAttributeValues(thisTree,thisNode,field "Type",comma,2)
Values
NameTypeDescription
return

The revXMLAttributeValues function returns a string.

RelatedKeyword: string
Property: nodes
Control Structure: function
Function: revXMLAttributes, revXMLCreateTree, revXMLCreateTreeFromFile, revXMLMatchingNode
Library: XML library
Glossary: value, Standalone Application Settings, standalone application, XML tree, return, attribute, LiveCode custom library
Securitydisk
Description

Use the revXMLAttributeValues function to list all the values an attribute has in an XML tree or a section of an XML tree, or to get the range of possible values.

If the revXMLAttributeValues function encounters an error, it returns an error message starting with "xmlerr".

Important: The revXMLAttributeValues 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.

Tagstext processing