copyNode

Copies a model node.

The specified node, and possibly the subtree under that node, are copied to a different location in the model, possibly even to another DOM in the model.


Tag Summary
 
required <copyNode node="value" name="value" parent="value" recursive="value" />
 
full tag <copyNode node="value" name="value" parent="value" recursive="value" useName="value" />

Required Attributes
 
node A query expression specifying a single target node to copy.
name The element name of the new node created by the copy action
parent A query expression specifying the single node that will be the parent of the new node
recursive A true/false value indicating whether the entire subtree under the source node should be copied (true) or whether just the one node described by the node attribute should be copied

Optional Attributes
 
useName A name that will be associated with the newly created node and which can be used as a variable name is subsequent query expressions

Example
 
<copyNode
        node="button-click"
        name="event"
        parent="event-list"
        recursive="true"
        useName="current-event" />

This copyNode tag locates the model element (called the source node) associated with the name "button-click" and copies that element to create a new element under the node associated with the name "event-list". Because the recursive attribute is set to "true", the entire DOM subtree under the source node is copied, too. When the source node is copied, the new node's name is set to "event" and the new node is associated with the name "current-event".


© Copyright IBM Corporation 2000, 2006. All Rights Reserved.