HTML and CSS Reference
In-Depth Information
In this case, the FOAF namespace is also required to make the foaf:primaryTopic meaningful. The declaration of
the additional namespace should be provided on the html element, as discussed in the previous section (Listing 3-39).
The XHTML Body
The XHTML document body is similar to the HTML body from the document structuring point of view. However,
XHTML is case-sensitive. Consequently, the JavaScript event handler onload cannot be written with the same camel
case notation onLoad used in HTML. It should be in lowercase (Listing 3-50).
Listing 3-50. Case-Sensitive Event Handler in XHTML
<body onload="function();" >
Moving from HTML to XHTML
For over a decade, a common task in web site standardization was to convert HTML documents into XHTML.
However, with the release of a brand new line of HTML, more and more web developers intend to use HTML5, mainly
due to its vocabulary and APIs. This does not mean, however, that HTML syntax must be preferred, because HTML5
documents can be written in XML serialization too (XHTML5). There are several reasons to use stricter markup.
Although some changes to be made on HTML documents while upgrading to XHTML are straightforward, there are
significant differences between the two formats in features and behavior that need to be considered. Since XHTML is
the reformulation of HTML 4 as an application of XML, it can be used as an XML-conforming language with all of its
attendant benefits:
Strict markup : Unlike HTML, XHTML complies with strict conventions. As a result, there are
no missing end tags, overlapping elements, or unnecessary attributes, just pure code. XHTML
is well-formed and easy to write, interpret, and read. Content and styles are separated.
Easy introduction of new markup : New elements and attributes can be added quite easily
through XHTML modules.
XML conformance : As such, they are readily viewed, edited, and validated with standard XML
DOM choice : Applets and scripts, and other applications can apply either the HTML
Document Object Model or the XML Document Object Model.
Interoperability : As web markup languages evolve, documents that conform to XHTML
conventions will be more likely to interoperate within different user agents of the future.
Additionally, backward- as well as forward-compatibility can be ensured with appropriate markup.
Specific Markup Languages
Beyond the general-purpose HTML and XHTML markup languages, there are more specific languages such as the
ones that represent vector graphics (SVG), mathematical annotations (MathML), multimedia presentations (SMIL),
or textual information synchronized with other media (TTML [53]). Such languages are used either in a specific
external file or their reserved words are written directly in general-purpose markup. The following sections provide an
overview of SVG and MathML.
Search WWH ::

Custom Search