Stylus Studio XML Editor

Table of contents

Appendices

5.4 Namespace Nodes

Namespace Nodes

Each element has an associated set of namespace nodes, one for each distinct namespace prefix that is in scope for the element (including the xml prefix, which is implicitly declared by the XML Namespaces Recommendation XMLNAMES) and one for the default namespace if one is in scope for the element. The element is the [parent] of each of these namespace nodes; however, a namespace node is not a child of its parent element. Elements never share namespace nodes: if one element node is not the same node as another element node, then none of the namespace nodes of the one element node will be the same node as the namespace nodes of another element node. This means that an element will have a namespace node:

  • for every attribute on the element whose name starts with xmlns:;

  • for every attribute on an ancestor element whose name starts xmlns: unless the element itself or a nearer ancestor redeclares the prefix;

  • for an xmlns attribute, if the element or some ancestor has an xmlns attribute, and the value of the xmlns attribute for the nearest such element is non-empty

    NOTE: 

    An attribute xmlns="" "undeclares" the default namespace (see XMLNAMES).

A namespace node has an [expanded-name] : the local part is the namespace prefix (this is empty if the namespace node is for the default namespace); the namespace URI is always null.

The [string-value] of a namespace node is the namespace URI that is being bound to the namespace prefix; if it is relative, it must be resolved just like a namespace URI in an [expanded-name] .