<doc>
  <legacy_id>1550</legacy_id>
  <name>revXMLCreateTree</name>
  <type>function</type>
  <syntax>
    <example>revXMLCreateTree(<i>XMLText</i>, <i>dontParseBadData</i>, <i>createTree</i>, <i>sendMessages</i>)</example>
  </syntax>
  <library>XML library</library>
  <objects>
  </objects>
  <synonyms>revXMLCreateTree
  </synonyms>
  <classification>
    <category>Text and Data Processing</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <command tag="revXMLAppend">revXMLAppend Command</command>
    <command tag="revXMLDeleteAllTrees">revXMLDeleteAllTrees Command</command>
    <command tag="revXMLMoveNode">revXMLMoveNode Command</command>
    <function tag="revXMLValidateDTD">revXMLValidateDTD Function</function>
    <function tag="revXMLTrees">revXMLTrees Function</function>
    <message tag="revXMLStartTree">revXMLStartTree Message</message>
  </references>
  <history>
    <introduced version="2.0">Added.</introduced>
    <changed version="6.5"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
    <disk access="???"/>
  </security>
  <summary>Creates an <glossary tag="XML tree">XML tree</glossary> structure from <glossary tag="XML">XML</glossary> text data.</summary>
  <examples>
    <example>revXMLCreateTree(field "XML Data",true,true,false)</example>
    <example>put revXMLCreateTree(theData,false,true,false) into theError</example>
  </examples>
  <description>
    <p>Use the <b>revXMLCreateTree</b> <control_st tag="function">function</control_st> to make <glossary tag="XML">XML</glossary> text into an <glossary tag="XML tree">XML tree</glossary> that you can use with other <glossary tag="XML library">XML library</glossary> <glossary tag="command">commands</glossary> and <glossary tag="function">functions</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>XMLText</i> is a <keyword tag="string">string</keyword>.</p><p/><p>The <i>dontparseBadData</i> is true or false.</p><p/><p>The <i>createTree</i> is true or false.</p><p/><p>The <i>sendMessages</i> is true or false.</p><p/><p><b>Value:</b></p><p>The <b>revXMLCreateTree</b> <control_st tag="function">function</control_st> returns a tree ID which can be used to refer to the tree in other <glossary tag="XML library">XML library</glossary> <glossary tag="command">commands</glossary> and <glossary tag="function">functions</glossary>. The tree ID is always a positive <keyword tag="integer">integer</keyword>. (If the <i>createTree</i> is false, the <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> zero.)</p><p/><p>If the function encounters an error while parsing the data, it returns an error message beginning with "xmlerr".</p><p/><p><b>Comments:</b></p><p>If the <i>dontparseBadData</i> is false, the <b>revXMLCreateTree</b> <control_st tag="function">function</control_st> tries to parse <glossary tag="XML">XML</glossary> data even if it is not well-formed. Otherwise, the <control_st tag="function">function</control_st> stops executing as soon as it encounters data that is not well-formed <glossary tag="XML">XML</glossary>.</p><p/><p>If the <i>createTree</i> is true, the <control_st tag="function">function</control_st> creates a tree structure in memory. Otherwise, the <control_st tag="function">function</control_st> simply parses the <glossary tag="XML">XML</glossary> data without creating an <glossary tag="XML tree">XML tree</glossary>.</p><p/><p>If the <i>sendMessages</i> is true, the <message tag="revXMLStartTree">revXMLStartTree</message>, <message tag="revStartXMLNode">revStartXMLNode</message>, <message tag="revStartXMLData">revStartXMLData</message>, <message tag="revEndXMLNode">revEndXMLNode</message>, and <message tag="revXMLEndTree">revXMLEndTree</message> <glossary tag="message">messages</glossary> are sent while the <glossary tag="XML">XML</glossary> data is being parsed. Otherwise, these <glossary tag="message">messages</glossary> are not sent.</p><p/><p>If the <b>revXMLCreateTree</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>revXMLCreateTree</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>
