Compound documents

Mixing XML vocabularies

With the XML namespace mechanism several XML vocabularies can be used in a single document. For instance, this paragraph which is coded in XHTML is followed by a mathematical expression in MathML:

Furthermore, namespaces can be nested. The drawing below is an example of nested namespaces. It is an SVG element included in an XHTML document. It contains itself other objects belonging to different namespaces:

Advantages

Using a single model and a single language for representing all elements within the document brings a number of advantages. It allows users to manipulate the document in an uniform way, as the representation mode is itself uniform.