About XML Names

Each XML name that appears in an XML documents (for instance, the name of an XML element or attribute) is not merely a character string. Rather, it may be considered as a vector of three components:

  1. Namespace URI
  2. Local Name
  3. Prefix
The {Namespace URI; Local Name} pair is what actually identifies the XML name. The URI identifies the entire namespace to which the given XML name belongs. The Local Name is a unique name within that namespace.

However, what you see in an XML document as an XML name is called qualified name, which normally looks like the following:

prefix:localName
The prefix is a shortcut reference to the Namespace URI that depends on the context (i.e. the location) within the XML document where the XML name is used.

The context determines the binding between the prefix and the actual namespace URI, which is defined using one of the special


xmlns:prefix
xmlns
attributes within an XML element associated with the given context or within another element somewhere on the ancestor element tree.

In particular that means, that in the same XML document the same XML name may appear with one namespace prefix at the location on one document's tree branch and another prefix (or not at all) at the location on another branch.

This all may be important because for the purposes of documentation generation, it may be required that XML names look in the documentation the same as they are used in the corresponding parts of the source XML documents (by which the documentation is generated).

See Also:

Generator Object Model | Object Types | QName; QName(), toQName(), adaptQName(), findNSByPrefix(), findPrefixByNS()