Introduction to XHTML: Extensible Markup Language
February 2, 2000
Extensible Markup Language (XML)
is a human-readable, machine-understandable,
general syntax for describing hierarchical data,
applicable to a wide range of applications (databases, e-commerce, Java,
web development, searching, etc.).
Custom tags enable the definition, transmission, validation, and
interpretation of data between applications and between organizations.
XML is not a single, predefined markup language:
it's a language for describing other languages which lets you design
your own markup.
A predefined markup language like HTML defines a way to describe
information in one specific class of documents:
XML lets you define your own customized markup languages for different
classes of document.
XML is a simplified subset of
SGML,
the Standard Generalised Markup Language.
SGML is a language for describing markup languages,
particularly those used in electronic document exchange,
document management, and document publishing.
HTML is a language defined in SGML.
SGML is an international standard for the definition of
device-independent,
system-independent methods of representing texts in electronic form.
More precisely, SGML is a metalanguage,
i.e. a method of formally describing a language, in this case, a
markup language.
XML was conceived as a means of regaining the power and flexibility of
SGML without most of its complexity.
Although a restricted form of SGML,
XML nonetheless preserves most of SGML's power and richness,
and yet still retains all of SGML's commonly used features.
While retaining these beneficial features,
XML removes many of the more complex features of SGML that make the
authoring and design of suitable software both difficult and costly.
The purpose of XML is to provide an easy to use subset of SGML that
allows for custom tags to be processed.
Custom tags will enable the definition, transmission and
interpretation of data structures between cooperating processes.
p>
XML is extensible because it is a metalanguage,
which enables one to write a
Document Type Definition (DTD) and define the rules of the
language so the document can be interpreted by the document receiver.
XML is a system for defining, validating, and sharing document formats.
XML uses tags (for example <em>emphasis</em>
for emphasis), to distinguish document structures,
and attributes.
Tags
specify structural elements in a document, such as headings:
<h2> Tags and Attributes </h2>
Tags begin with a left-angle bracket < and end with a
right-angle bracket >. The first word after the left-angle
bracket is the tag's name. Any further words and characters are the
attributes.
Attributes are specified by name/value pairs, e.g name = "value",
e.g. align="right".
A tag is therefore the basic 'item', and an attribute is some
extra detail such as how to align the content.
Note that despite popular usage, "alt" is an attribute - it is not a tag!
An element comprises three parts: a start tag, content, and an end tag.
Most tags possess 'closing tags' such as </h2>,
which mark the place where the effect of the 'opening' tag should stop.
An XML namespace is a
collection of names, identified by a
URI
[uniform resource identifier] reference,
which are used in XML documents as element types and attribute names;
In other words,
the XHTML namespace is the list of valid tags that can be used in XHTML.
Namespaces provide a simple method for qualifying element and attribute
names used in XML documents by associating them with namespaces.
This allows element names from different documents to be combined in one
document without confusion in cases where names happen to be the same.
You now need to include a namespace attribute
xmlns in the <HTML> tag.
The namespace attribute defines which namespace the document uses
<html xmlns="http://www/w3/org/TR/xhtml1">
In XML you can combinine multiple namespaces in a single
document which allows you to have two <title> tags,
for example; one for the document (as usual),
and one for the book that the document is about.
Introduction to XHTML: Why do we need XHTML?
Introduction to XHTML, with eXamples
Introduction to XHTML: Document Type Definitions
|