Name: revXMLInsertNode

Type: command

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

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

Introduced: 2.7.4

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Security: disk

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

Parameters:
treeId: The  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.
name: name is the name of the new node.
contents: The  contents is 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 <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section on the General screen of the <Standalone Application Settings> window, make sure "XML Library" is selected in the list of script libraries.

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