Name: revXMLAttributeValues

Type: function

Syntax: revXMLAttributeValues(<treeID>, <startNode>, <childName>, <attributeName>, <delimiter>, <depth>)

Summary: <return|Returns> a list of the <value|values> of a specified <attribute> for the specified <nodes> in an <XML tree>.

Introduced: 2.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Security: disk

Example:
revXMLAttributeValues(2,"/",,"Age",return,-1)

Example:
get revXMLAttributeValues(thisTree,thisNode,field "Type",comma,2)

Parameters:
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 (string): 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 (string): 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.

Returns: The <revXMLAttributeValues> <function> returns a <string>.

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 <return|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 <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section on the General screen of the <Standalone Application Settings> window, make sure "XML Library" is selected in the list of script libraries.

References: nodes (property), function (control_st), string (keyword), revXMLAttributes (function), revXMLMatchingNode (function), value (glossary), Standalone Application Settings (glossary), standalone application (glossary), XML tree (glossary), return (glossary), attribute (glossary), XML library (library), Revolution custom library (library)

Tags: text processing
