XML technologies / XML / XML in a Nutshell / XML reference / Some annotated sample documents
(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)
These examples mainly help explain XML syntax. They make it easier to demonstrate the connection between a particular part of XML and the corresponding syntactic structure. The sample document and its DTD include features extending XML 1.0. These are defined in the XML 1.0 recommendation and Namespaces in XML (Namespaces in XML).
The following sample XML application describes the construction of a piece of furniture. Each language construct is shown in a box with an annotation pointing to its syntax description. By finding a construct in the example and looking up its theoretical definition, you can recognize and learn unfamiliar XML syntax structures. The application consists of four files:
buecherregal.xml
The document shown in the figure buecherregal.xml describes a bookcase. It uses the document type described in
moebel.dtd.moebel.dtd
The XML document type definition, shown in the figure moebel.dtd provides a simple grammar for expressing a piece of furniture’s components and assembly instructions.
buecherregal_ex.ent
The external entity, in the file shown in the figure buecherregal_ex.ent contains additional bookcase descriptions for the document buecherregal.xml.
teileliste.ent
The figure teileliste.ent shows another external entity example. This file contains the parts used in the bookcase example.
Figure: buecherregal.xml
Figure: moebel.dtd
Figure: buecherregal_ex.ent
Figure: teileliste.ent
Copyright © 2005 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "XML in a Nutshell" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top