• +49-(0)721-402485-12
Ihre Experten für XML, XQuery und XML-Datenbanken

Schema description with XML Schema

With the DTD concept, XML 1.0 has defined a mechanism for the schematic description of XML documents. This concept was taken over from SGML and is therefore strongly tailored to document-orientated requirements. Basically, a DTD is used to the describe the content models for elements. Data type aspects play a minor role and are more pronounced for attributes than for elements.

Within the scope of the – compared to SGML – much wider application of XML (and also in connection with the storage of XML in databases), deficits in the DTD approach quickly become apparant. An important point of criticism is the fact that the DTD syntax is no XML. As a consequence, a DTD cannot be treated like a XML document. Moreover, the schematic description of XML documents belonging to a specific namespace by using a DTD is only possible with tricks and by abondoning the free choice of the namespace token. In the end, the deficient type concept disturbs in many application scenarios.

With XML Schema, the W3C has standardised a new possibility for the schematic description of XML documents. XML Schema offers a wide range of predefined types as well as user-defined types and structural mechanisms of inheritance between them. Elements may be global, as in the DTD, or, which is not possible in a DTD, only local. Mechanisms of reutilisation at type, element and attribute level enable a modular design. The namespace concept is fully supported. On the following pages, you can find a short overview of those concepts of XML being particularly important for XQuery.


Source: "XQuery – Grundlagen und fortgeschrittene Methoden", dpunkt-Verlag, Heidelberg (2004)

<< backnext >>