Namespaces
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
When you have nodes or attribute nodes that use namespaces, you need to supply the namespace information when you create the nodes. Therefore, there are different methods for creating nodes without namespaces and nodes with namespaces, as shown in the following table.
| Use this method for no namespaces | Use this method for namespaces |
|---|---|
| hX-document:CREATE-NODE( ) | hX-document:CREATE-NODE-NAMESPACE( ) |
| hX-noderef:SET-ATTRIBUTE( ) | hX-noderef:SET-ATTRIBUTE-NODE( ) |
Syntax
This is the syntax for the CREATE-NODE-NAMESPACE( ) method:
|
- x-noderef-handle
- A valid X-noderef handle to use for the new namespace aware DOM node.
- namespace-URI
- Represents the URI reference, which identifies the namespace. The namespace name should have the characteristics of uniqueness and persistence. It does not need to be directly usable for retrieval of a schema, but ordinary URLs can also be used to achieve this effect.
- qualifiedName
- The qualified name is the name of an element or attribute optionally prefixed
by a valid namespace prefix and a colon character. Unless you are using
a default namespace, a prefix is required and should be set to the prefix
specified when you declared the namespace using the
xmlnsattribute. - type
- A character
expression that represents the node
SUBTYPE, which will be eitherELEMENTorATTRIBUTE.
The
following example creates an ELEMENT node with
a namespace and an ATTRIBUTE node with a namespace
on an X-document object:
|
Syntax
This is the syntax for the CREATE-NODE-NAMESPACE( ) method:
|
- attr-node-handle
- A valid X-noderef handle created by
CREATE-NODE-NAMESPACE( )orCREATE-NODE( ).
The
following example creates an ELEMENT node with
a namespace and an ATTRIBUTE node with a namespace
on an X-document object:
ABL:XML: |
Note: Do not mix calls to the
CREATE-NODE( ) method
and the CREATE-NODE-NAMESPACE( ) method
in the same DOM tree.