<doc>
  <legacy_id>3029</legacy_id>
  <name>revXMLInsertNode</name>
  <type>command</type>
  <syntax>
    <example>revXMLInsertNode <i>treeId, siblingNode, name, contents, </i>[<i> location </i>]</example>
  </syntax>
  <library>XML library</library>
  <objects>
  </objects>
  <synonyms>revInsertXMLNode
  </synonyms>
  <classification>
  </classification>
  <references>
    <command tag="revXMLAppend">revXMLAppend Command</command>
  </references>
  <history>
    <introduced version="2.7.4">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>Inserts a node as a sibling of siblingNode in the specified tree.</summary>
  <examples>
    <example>revXMLInsertNode tTreeId, "sister", field "Name", field "Contents", "before"</example>
  </examples>
  <description>
    <p>Use <b>revXMLInsertNode </b>to insert a node into an XML tree.</p><p/><p><b>Parameters:</b></p><p>The <i>treeId</i> is the  the number returned by the <function tag="revXMLCreateTree">revXMLCreateTree</function> or <function tag="revXMLCreateTreeFromFile">revXMLCreateTreeFromFile</function> function when you created the XML tree.</p><p/><p>The <i>siblingNode</i> is the node the new node will have as sibling after insertion.</p><p><i>name</i> is the name of the new node.</p><p/><p>The<i> contents</i> is the text to place in the new node.</p><p/><p>If <i>location</i> is not present or is equal to "after", the node will be added as the next sibling of <i>siblingNode</i>. If <i>location</i> is "before" then the node will be added as the previous sibling of <i>siblingNode</i>.</p><p/><p><b>Comments:</b></p><p>If the <b>revXMLInsertNode</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>revXMLInsertNode</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>
