Compound documents

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:

F ( y ) = 1 2 n y ( k = 1 n sin 2 x k ( t ) ) f   ( t ) dt

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:

  1. The blue (or pink?) rectangle contains some XHTML elements (a H2 heading and a paragraph).
  2. The paragraph in the rectangle contains a MathML expression.
This text in this document does not make much sense.

XML Document

This document is a document with an equation r = x 2 + y 2 displayed inline.

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.