Skip to main content

revXMLTree

Type

function

Summary

Returns a list of the nodes in an XML tree, in a form that shows their parent/child relationships.

Syntax

revXMLTree(<treeID>, <startNode>, <nodeDelim>, <padding>, <includeChildCount>, <depth>)

Description

Use the revXMLTree function to obtain a text "tree-style" view of an XML tree's nodes.

To display the entire XML tree, specify the root node returned by the revXMLRootNode function as the startNode.

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

Important

The revXMLTree 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.

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.

nodeDelim

string

A string that separates each node's name from the rest.

padding

string

A string that is placed before the name of each node to show its depth in the tree. No padding is placed before the startNode's name.

includeChildCount

bool

If the includeChildCount is true, each node's name is followed by the node's positional predicate, ie which child number the node is.

depth

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

Examples

revXMLTree(3,"/Sound",return,space,false,1)
revXMLTree(currTree,foundNode,space,,true,2)
put revXMLTree(myTree,theNode,return,tab,false,-1) into field "Node List"

constant: tab

control structure: function

function: revXMLText, revXMLMatchingNode

glossary: LiveCode custom library, Standalone Application Settings, node, standalone application, XML tree, return

keyword: string

library: XML library

property: nodes

Compatibility and Support

Introduced

LiveCode 2.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?