<doc>
  <legacy_id>2343</legacy_id>
  <name>revXMLTree</name>
  <type>function</type>
  <syntax>
    <example>revXMLTree(<i>treeID</i>,<i>startNode</i>,<i>nodeDelim</i>,<i>padding</i>,<i>includeChildCount</i>,<i>depth</i>)</example>
  </syntax>
  <library>XML library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Text and Data Processing</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <function tag="revXMLMatchingNode">revXMLMatchingNode Function</function>
    <function tag="revXMLText">revXMLText Function</function>
  </references>
  <history>
    <introduced version="2.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
    <disk access="???"/>
  </security>
  <summary><glossary tag="return">Returns</glossary> a list of the <property tag="nodes">nodes</property> in an <glossary tag="XML tree">XML tree</glossary>, in a form that shows their parent/child relationships.</summary>
  <examples>
    <example>revXMLTree(3,"/Sound",return,space,false,1)</example>
    <example>revXMLTree(currTree,foundNode,space,,true,2)</example>
    <example>put revXMLTree(myTree,theNode,return,tab,false,-1) into field "Node List"</example>
  </examples>
  <description>
    <p>Use the <b>revXMLTree</b> <control_st tag="function">function</control_st> to obtain a text "tree-style" view of an <glossary tag="XML tree">XML tree's</glossary> <property tag="nodes">nodes</property>.</p><p/><p><b>Parameters:</b></p><p>The <i>treeID</i> is the number <glossary tag="return">returned</glossary> by the <function tag="revXMLCreateTree">revXMLCreateTree</function> or <function tag="revXMLCreateTreeFromFile">revXMLCreateTreeFromFile</function> <control_st tag="function">function</control_st> when you created the <glossary tag="XML tree">XML tree</glossary>.</p><p/><p>The <i>startNode</i> is the path to the <glossary tag="node">node</glossary> where you want to start.</p><p/><p>The <i>nodeDelim</i> is a string that separates each node's name from the rest.</p><p/><p>The <i>padding</i> is a <keyword tag="string">string</keyword> that is placed before the name of each node to show its depth in the tree. No <i>padding</i> is placed before the <i>startNode's</i> name.</p><p/><p>The <i>includeChildCount</i> is true or false. If the <i>includeChildCount</i> is true, each node's name is followed by the node's positional predicate, ie which child number the node is.</p><p/><p>The <i>depth</i> specifies how many generations of the <glossary tag="XML tree">XML tree</glossary> to show. If you specify zero, only the <i>startNode</i> is shown; if you specify 1, the <i>startNode</i> and its <glossary tag="child node">child nodes</glossary> are shown, but not their <glossary tag="child node">child nodes</glossary>; and so on. To show all generations, specify -1 as the <i>depth</i>.</p><p/><p><b>Value:</b></p><p>The <b>revXMLTree</b> <control_st tag="function">function</control_st> returns a <keyword tag="string">string</keyword>.</p><p/><p><b>Comments:</b></p><p>To display the entire XML tree, specify the root node returned by the <b>revXMLRootNode</b> <control_st tag="function">function</control_st> as the <i>startNode</i>.</p><p/><p>Typically, you use <b>return</b> as the <i>nodeDelimiter</i> and <constant tag="tab">tab</constant> as the <i>padding</i>. The resulting list of nodes is displayed one node per line, with as many leading tabs as the <glossary tag="node">node's</glossary> depth.</p><p/><p>If the <b>revXMLTree</b> <control_st tag="function">function</control_st> encounters an error, it <glossary tag="return">returns</glossary> an error message starting with "xmlerr".</p><p/><p><img src="202653"/> <b>Important!</b> The <b>revXMLTree</b> <control_st tag="function">function</control_st> is part of the <glossary tag="XML library">XML library</glossary>. To ensure that the <control_st tag="function">function</control_st> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section on the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "XML Library" is selected in the list of script libraries.</p>
  </description>
</doc>