background image
and what is likely to occur in the future as a result of the use of XML and its related
specifications.
H o w X M L Te c h n o l o g i e s Wo r k
Markup and Display: Tags and Stylesheets
XML tags look identical to their HTML counterparts, but the rules governing their use
are significantly stricter. Unlike the more forgiving HTML, each and every XML tag
must be opened and closed, and rules on the nesting of brackets must be observed or the
document will not be parsed successfully. A fundamental advantage of XML is its extensi-
bility: users can create their own tags and vocabularies.When combined with DTDs or
schemata (see below) this allows content developers to define and control documents and
their permitted contents to a very high degree.They can also create a rich array of possi-
ble ways of discovering information.
In terms of delivery, XML content can be uniformly displayed using stylesheet languages
such as Cascading Stylesheets (CSS) and the more versatile XML Stylesheet Language (XSL).
HTML users may already be familiar with stylesheets, which are used to define the ways
in which certain Web page aspects such as fonts, text sizes, colours, and images are displayed.
Stylesheets can be reused to enforce uniformity across a potentially unlimited number of
documents or Web pages.
Structured Documents: DTDs and Schemata
XML is often called a self-describing language, insofar as XML syntax is itself defined
in XML. XML variants exist for an ever-growing number of industries and domains.
Each of these will have a Document Type Definition, or DTD, which is a kind of glossary
that outlines exactly what kinds of XML tags a document may contain, and where the
tags should be placed within it. Like stylesheets, DTDs are reusable and can be shared
simultaneously by multiple XML documents or Web sites. A DTD can be linked to an
XML document externally using a URL, or it can be embedded at the top of the XML
document it describes.The latter approach is easier, although less efficient than the former.
Creating a DTD is a reasonably simple task, and learning how to do this should not be
too difficult or time-consuming.The designing of a DTD is more time-consuming, but
it is the crucial first step.
DTDs, however, are on the way out, and are being steadily replaced by more versatile
The XML Family
of Technologies
48
HTML and XML: sample code
Univ
ersity of Glasgow
TWR2004_01_layout#62 14.04.2004 14:07 Uhr Seite 48