HTML and CSS Reference
such as a Web browser. XML also provides a way to separate the data from the HTML
document, so that when the data is updated, the HTML document simply displays the
new data, allowing for dynamic Web pages that change as the data changes.
Designing XML Documents
Like HTML, XML is a subset
of Standard Generalized
Markup Language (SGML).
SGML gives developers the
ability to create their own
elements. XML inherits this
ability from SGML. XML
does not replace HTML,
but it provides a means to
extend and enhance the
use and appearance of a
document. Developers can
create XML documents
manually using any editor,
or generate an XML
document using existing
tables in a Microsoft SQL
Server or Microsoft Access
database, and then bind
them to their Web pages.
XML uses tags to describe the structure of a document and its contents. XML tags do
not format the display of text as with an HTML document. XML provides a flexible way
for organizations to share common data and to integrate data with Web pages. The main
XML document created in this chapter is a list of products available at Calumet Restaurant
Supply, which will serve as a database (or data island). The XML data will be formatted by
Formatting XML documents for display on a Web page requires binding or linking
a style sheet to the XML document, which formats the elements of the XML document as
they appear in a browser. An XML document can be formatted with Cascading Style Sheets
(CSS) or an Extensible Stylesheet Language (XSL) style sheet. Extensible Stylesheet
Language ( XSL ) is used to create style sheets for formatting structured XML data. XSL
style sheets provide more flexibility and control over XML documents than CSS. While
CSS can format individual XML elements, XSL can control the order of elements or add
other information. Most developers prefer XSL style sheets over CSS for formatting
As you learned in Chapter 1, the World Wide Web Consortium (W3C) oversees and
develops standards for Web development. To help ensure consistency among the discipline-
specific tags created in XML, the W3C has defined a set of standards, or goals, for XML,
shown in Table 12-1. The goals provide a framework for all future XML development and
XML-related, discipline-specific markup languages.
Benefits of XML to
standards have influenced
HTML standards. One
version of HTML, XHTML
(now in version 2.0)
was created to provide
a seamless relationship
between XML and its
presentation on the World
Wide Web. One aspect
of this development is
the required reliance on
style sheets for formatting
the display of Web pages.
The development of
HTML5 and CSS3 brings
the HTML language
more in line with XML
Table 12-1 Design Goals for XML
XML shall be straightforwardly usable over the Internet.
XML shall support a wide variety of applications.
XML shall be compatible with SGML.
It shall be easy to write programs that process XML documents.
The number of optional features in XML is to be kept to the absolute minimum, ideally zero.
XML documents should be human-legible and reasonably clear.
The XML design should be prepared quickly.
The design of XML shall be formal and concise.
XML documents shall be easy to create.
Terseness in XML markup is of minimal importance.
Using XML documents as databases is just one of the many ways Web developers
use XML. The creation and use of these databases is the central focus of this chapter.
As the W3C group continues to develop XML standards, businesses and organizations
will find numerous new uses for XML. An important goal of XML is to allow the creation
of discipline-specific markup language tags. Table 12-2 on the next page is a partial list of
uses and extended markup languages created using XML.