EXTENDING HTML
Many of you are, no doubt, familiar with the Hypertext Markup Language,
more commonly known as HTML. This markup language is the language of
the Web. However, there's a new kid in town named XHTML. This week's
XML reveals a little bit about the mystery behind eXtended HTML.
WHAT'S WRONG WITH HTML?
Nothing is wrong with HTML. But there are many aspects of HTML that
could be better, areas where a set of standards could help resolve
issues. There are also certain items lacking in HTML, such as
extensibility and accessibility. So, while HTML isn't broken, XHTML
only aims to enhance the available features.
THE EXTENDED FAMILY
The World Wide Web Consortium (W3C), the organization responsible for
creating Web standards such as HTML and XML, has created a family in
XHTML. Rather than just a single XML application, XHTML refers to the
collective family of XML grammars, which define document types based on
the HTML version 4 standard. This family currently includes XML
specifications for the three HTML 4 document types: Strict,
Transitional, and Frameset.
RELATIONSHIPS
The relationships between HTML and XHTML are easy to understand. In
fact, the actual documents themselves are easy to understand. XHTML
provides a stricter, but also cleaner, implementation of most HTML
tags. Because an XHTML document must adhere to XML standards, case-
sensitivity is one area where XHTML is not as lenient as HTML. With
HTML, you can use any casing you want for your tag names. In fact,
mixed casing can be used just as easily and effectively as all
uppercase or all lowercase. With XHTML, this is not the case, so to
speak. XHTML coders must use exclusively lowercase tags.
Because XHTML is an XML grammar, normal XML rules also apply to the use
of tags. Tags cannot be left unterminated in an XHTML document. This
includes commonly unterminated HTML tags such as the break tag,
,
horizontal rule,
. Rather than use the HTML
tag, XHTML users must be sure to either close the tag, as in
,
or use an empty tag such as