<doc>
  <legacy_id>1726</legacy_id>
  <name>revXMLAddNode</name>
  <type>command</type>
  <syntax>
    <example>revXMLAddNode <i>treeID</i>, <i>parentNode</i>,<i>nodeName</i>,<i>nodeContents, </i>[<i>location</i>]</example>
  </syntax>
  <library>XML library</library>
  <objects>
  </objects>
  <synonyms>revAddXMLNode
  </synonyms>
  <classification>
    <category>Text and Data Processing</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <command tag="revXMLDeleteNode">revXMLDeleteNode Command</command>
    <command tag="revXMLAppend">revXMLAppend Command</command>
    <command tag="revXMLMoveNode">revXMLMoveNode Command</command>
  </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>Adds a <glossary tag="child node">child node</glossary> to the specified parent <glossary tag="node">node</glossary> in an <glossary tag="XML tree">XML tree</glossary>.</summary>
  <examples>
    <example>revXMLAddNode 9,"/","Balls",""</example>
    <example>revXMLAddNode myTree,theNode,the short name of me,field "Contents"</example>
  </examples>
  <description>
    <p>Use the <b>revXMLAddNode</b> <glossary tag="command">command</glossary> to add a <glossary tag="node">node</glossary> to an <glossary tag="XML tree">XML tree</glossary>.</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>parentNode </i>is the <glossary tag="node">node</glossary> whose child the <glossary tag="node">node</glossary> being created will be.</p><p/><p>The <i>nodeName</i> is the name of the new <glossary tag="node">node</glossary>.</p><p/><p>The <i>nodeContents</i> is the text to place in the new <glossary tag="node">node</glossary>.</p><p/><p>The <i>location </i>is an optional argument. If it is not present or if it is equal to "after", the node will be added as the last child of parentNode. If <i>location</i> is "before" then the node will be added as the first child of <i>parentNode</i>.</p><p/><p><b>Comments:</b></p><p>If the <b>revXMLAddNode</b> <glossary tag="command">command</glossary> encounters an error, the <function tag="result">result</function> is set to an error message beginning with "xmlerr".</p><p/><p><img src="202653"/> <b>Important!</b> The <b>revXMLAddNode</b> <glossary tag="command">command</glossary> is part of the <glossary tag="XML library">XML library</glossary>. To ensure that the <glossary tag="command">command</glossary> 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>
