Name: revXMLInsertNode

Type: command

Syntax: revXMLInsertNode <treeId>, <siblingNode>, <nodeName>, <contents>, [<location>]

Summary:
Inserts a node as a sibling of siblingNode in the specified tree.

Associations: xml library

Introduced: 2.7.4

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Security: disk

Example:
revXMLInsertNode tTreeId, "sister", field "Name", field "Contents", "before"

Parameters:
treeId:
The number returned by the <revXMLCreateTree> or
<revXMLCreateTreeFromFile> function when you created the XML tree.

siblingNode:
The node the new node will have as sibling after insertion.

nodeName:
The name of the new node.

contents:
The text to place in the new node.

location:
If location is not present or is equal to "after", the node
will be added as the next sibling of <siblingNode>. If location is 
"before" then the node will be added as the previous sibling of 
<siblingNode>.

The result:
If the <revXMLInsertNode> <command> encounters an error,
the <result> is set to an error message beginning with "xmlerr".

Description:
Use <revXMLInsertNode> to insert a node into an XML tree.

>*Important:*  The <revXMLInsertNode> <command> is part of the 
> <XML library>. To ensure that the <command> works in a 
> <standalone application>, you must include this 
> <LiveCode custom library|custom library> when you create your 
> <standalone application|standalone>. In the Inclusions pane of the 
> <Standalone Application Settings> window, make sure the "XML" 
> checkbox is checked.

References: revXMLAppend (command), result (function),
LiveCode custom library (glossary),
Standalone Application Settings (glossary),
standalone application (glossary), command (glossary),
XML library (library)

