Progress
Language Reference


INSERT-BEFORE( ) Method

Insert a node as a child of this document before another node (or last if the other node is unknown). This is one way to place the node into the document structure after the node has been created with the CREATE-NODE( ) or CREATE-NODE-NAMESPACE( ) method, cloned with the CLONE-NODE( ) method, or removed with the REMOVE-NODE( ) method. (Similar to the APPEND-CHILD( ) method.)

Return Type: LOGICAL

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

SYNTAX
INSERT-BEFORE( x-ref-handle1 , x-ref-handle2 ) 

x-ref-handle1

The handle that represents the node to insert as a child of this document.

x-ref-handle2

A handle that represents the XML node that the node is to be inserted before. If unknown, the node will be appended as the last child.

The following code fragment demonstrates the use of the INSERT-BEFORE( ) method. hNoderefParent ends up with hNoderef and hNoderef2 in that order:

. . .
hDoc:CREATE-NODE(hNoderef,bufField:NAME,"ELEMENT").
hNoderefParent:INSERT-BEFORE(hNoderef,hNoderef2).
. . . 


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