om.DomDocument.copy

Create a new element node by copying an existing node.

Syntax

copy(
   source om.DomNode,
   deep INTEGER )
  RETURNING result om.DomNode
  1. source references the source node to copy.
  2. deep is a boolean to control the recursive node copy.

Usage

Use the method copy() to create a new om.DomNode element node from an existing node.

Pass TRUE as second parameter to clone a complete tree of nodes.

To hold the reference to the new node, define a variable with the type om.DomNode type.

Example

DEFINE n, s om.DomNode
LET s = mydoc.createElement("Car")
LET n = mydoc.copy(s, TRUE)