Livecode Wiki
Advertisement

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

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

Examples:

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

Use revXMLInsertNode to insert a node into an XML tree.

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.

Parameters:

  • treeId: The number returned by the revXMLCreateTree orrevXMLCreateTreeFromFile 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 nodewill 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".

See also: XML library (library),

Advertisement