revXMLInsertNode

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
revXMLInsertNode <treeId>, <siblingNode>, <nodeName>, <contents>, [<location>]
Associationsxml library
Summary

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

Introduced2.7.4
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
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.

Example
revXMLInsertNode tTreeId, "sister", field "Name", field "Contents", "before"
Values
NameTypeDescription
The result

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

RelatedCommand: revXMLAppend
Function: result
Glossary: LiveCode custom library, Standalone Application Settings, standalone application, command
Library: XML library
Securitydisk
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 custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "XML" checkbox is checked.