PreviousNextIndex

CREATE-NODE( ) method

Create an XML node in the current document. The first parameter must be a valid X-noderef handle and will refer to the new XML node if the method succeeds. This method merely creates the XML node as part of the XML document. The INSERT-BEFORE or APPEND-CHILD methods are required to actually insert it into the document’s tree.

Return type: LOGICAL

Applies to: X-document object handle

Syntax
CREATE-NODE( x-node-handle , name , type ) 

x-node-handle
name
type

The following example demonstrates creating a node in a document. If hDoc is an X-document handle, and hNoderef and hNoderefChild are X-noderefs, this is how you would add hNoderefChild to hNoderef in the document associated with hDoc:

/* Assume hNoderef has previously been added to the tree. Create an ABL handle 
   that can refer to a node in an XML parse tree.*/ 
CREATE X-NODEREF hNoderefChild. 
/* Create an XML node whose name is "Address" & whose type is "ELEMENT" */ 
hDoc:CREATE-NODE(hNoderefChild, "Address", "ELEMENT") 
/* Put this child into the tree and ultimately into the document. */ 
hNoderef:APPEND-CHILD(hNoderefChild). 


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex