Compound documents

Mixing XML vocabularies

With the namespace mechanism of XML 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:

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.