Skip to content
uencoder

XML Namespace

XML namespaces attach a namespace URI to elements and attributes via xmlns:prefix="URI", avoiding name collisions between vocabularies.

Purpose

To qualify which vocabulary an element name belongs to in a mixed-vocabulary XML document, letting same-named elements coexist.

Mechanism

An xmlns:prefix="URI" declaration binds a prefix to a URI. The qualified name of an element or attribute is the pair (URI, localName). A default namespace xmlns="URI" applies to unprefixed elements.

Use cases

  • SOAP mixed vocabularies
  • SVG/MathML embedded in XHTML
  • Composing XML standards

Related tools

References