CREATE-NODE( ) method
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
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
|
- x-node-handle
- A valid X-noderef handle to use for the new XML node.
- name
- A character expression representing the NAME of the node. The relationship between the node NAME and SUBTYPE attributes is shown in the following table.
- type
- A character expression representing the node's SUBTYPE, which will be one of: ATTRIBUTE, CDATA-SECTION, COMMENT, DOCUMENT-FRAGMENT, ELEMENT, ENTITY-REFERENCE, PROCESSING-INSTRUCTION, TEXT.
| If the SUBTYPE is . . . | then the NAME attribute is . . . |
|---|---|
| ATTRIBUTE | The name of the attribute |
|
CDATA-SECTION COMMENT DOCUMENT-FRAGMENT TEXT |
A constant value; the name parameter is ignored |
| ELEMENT | The name of the XML tag, with any namespace prefix included |
| ENTITY-REFERENCE | The name of the entity referenced without leading ampersand and trailing semicolon |
| PROCESSING-INSTRUCTION | The target; the first token following the <? markup |
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:
|