Namespace support

XML namespaces provide a way to differentiate between elements with the same name.

An XML message is identified by the name of the root node. To accommodate namespaces, messages are identified by the namespace URL and the root node name. If a message does not specify a namespace, then the message only uses the root node name.

If a namespace is specified, then the TrxID is the namespace URL and the root node name separated by a colon.

If no namespace is specified, then the root node name is returned.

A namespace is declared in an XML document with a namespace attribute. This attribute can be xmlns or xmlns:name , where name is used to reference the namespace. The value of the attribute is a unique URL.

The system can identify an element or attribute by its namespace URL. Any namespaces that are defined in a message are stored in the OCM for reference. Representations of a namespace-qualified element or attribute have the namespace prefix that was imported during the generation of the OCM file.

When an XML message is parsed, the qualified name of an element or attribute is used to match against the OCM tree. The qualified name is the namespace URL and local name.

When an XML message is encoded, elements and attributes are namespace qualified automatically based on the information in the OCM file.