Progress
Language Reference


REPLACE-CHILD( ) Method

Replace an old XML node with a new node. The old XML node is not deleted, only disconnected from the structure. If the new XML node is already in the tree, it is first disconnected.

Return Type: LOGICAL

Applies To: X-document Object Handle, X-noderef Object Handle

SYNTAX
REPLACE-CHILD( new-handle , old-handle ) 

new-handle

The handle that represents the node to insert in the tree.

old-handle

The handle that represents the node to remove from the tree.

The following code fragment gets a reference to the fourth XML node on the document root, and removes it. hNoderef is still available for use after the remove, but is unlinked from hRoot. We then replace the root’s second child with this fourth child:

CREATE X-NODEREF hNoderef.
CREATE X-NODEREF hChild.
...
hRoot:GET-CHILD(hNoderef,4).
hRoot:REMOVE-CHILD(hNodeRef).
hRoot:GET-CHILD(hChild,2).
hRoot:REPLACE-CHILD(hNodeRef,hChild). 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095