| |
|
The HTML specification, currently in its 4th revision, has been the preeminent markup language used for Web publishing over the past decade. Providing a fixed (non-extensible) set of markup tags, however, has been one of HTML’s primary limitations. Additionally, HTML coding rules are extremely flexible, allowing for the inconsistent authoring and design of Web pages. These two characteristics put HTML in sharp contrast to XML, which provides an extensible framework and enforces strict coding standards based on concepts of well-formedness and validity.
|
|
As owners of both the HTML and XML specifications, the World Wide Web Consortium (W3C) has decided not to continue developing HTML. Instead, the functionality of HTML will be provided through an implementation of XML in a new markup language called XHTML.
|
|
Besides providing a consistent and extensible platform for presentation-level code, one of the W3C’s primary objectives is to deliver user-interface portability, allowing Web pages to become device-independent. To accomplish this, a stripped down version of XHTML, called XHTML Basic, has been created and defined in a separate specification that achieved recommendation status last December.
|
|
To Web designers and authors, XHTML 1.0 will likely be looked upon as just another version of HTML, but to back-end developers, it provides a new framework for the manipulation of Web user-interfaces in alignment with XML.
|
|
XHTML 1.0 supports all of the tags defined in HTML 4.0, but the original DTDs used by HTML have been replaced with the following three XML DTDs:
|
<!DOCTYPE html PUBLIC “-//W3C XHTML 1.0 Strict//EN” “DTD/xhtml1-strict.dtd”>
<!DOCTYPE html PUBLIC “-//W3C XHTML 1.0 Transitional//EN” “DTD/xhtml1- transitional.dtd”>
<!DOCTYPE html PUBLIC “-//W3C XHTML 1.0 Frameset//EN” “DTD/xhtml1- frameset.dtd”>
|
|
XHTML places a great deal of emphasis on the use of Cascading Style Sheets (CSS), and therefore supplies the Strict DTD which requires that all style attributes be placed in a separate CSS. The Transitional DTD permits the use of embedded style attributes for Web pages that need to support browsers which do not support CSS. The Frameset DTD is for the use of standard HTML frameset files.
|
|
Each of these DTDs impose a stricter adherence to well-formed coding rules. So strict, in fact, that use of any of these DTDs would invalidate 99% of the HTML content currently on the Web.
|
|
Web authors must place a reference to one of these DTDs at the beginning of every XHMTL document. Additionally, the HTML tag itself can contain a namespace reference allowing it to point to the standard W3C XHTML specification, or a customized extension.
|
|
The most significant changes Web authors will encounter when working with XHTML are syntactical. For instance, as with XML code, all XHTML body code must be lowercase, as follows:
|
Incorrect: < P ALIGN=”CENTER”>Life can be hell with XHTML</P>
Correct: < p align=”center”>Life can be swell with XHTML</p>
|
Additionally, element attributes must be enclosed with quotation marks, as follows:
Incorrect: <p align=center>Life can be hell with XHTML</p>
Correct: <p align=”center”>Life can be swell with XHTML</p>
|
|
|
return to homepage
SOA: Principles of Service Design
by Thomas Erl

An in-depth guide dedicated to service engineering with a thorough exploration of the design principles that comprise the service-orientation design paradigm (including a comparison with object-orientation).
Service-Oriented Architecture:
Concepts, Technology, and Design
by Thomas Erl

The first "how-to" guide to building SOA, providing coverage of WS-* specifications, .NET and J2EE platforms, and step-by-step processes for service-oriented analysis and design.
Service-Oriented Architecture:
A Field Guide to Integrating XML and Web Services
by Thomas Erl

The best-selling guide to service-oriented integration, providing hundreds of integration strategies and over sixty best practices.

For more information about either book, visit: www.soabooks.com
|
About SOA Systems

SOA Systems Inc. provides strategic SOA consulting services and offers a comprehensive SOA training program.

For more information see:

• www.soasystems.com

• www.soatraining.com

|
| |
| |
|
In order to comply with the well-formedness rules, all XHTML tag constructs must be properly nested, as follows:
|
Incorrect: <p align=”center”><b>Life’s a beech with XHTML</p></b>
Correct: <p align=”center”><b>Life’s a peach with XHTML</b></p>
|
|
…and end-tags must always be supplied:
|
Incorrect: <p align=”center”><b>Life’s a beech with XHTML</p>
Correct: <p align=”center”><b>Life’s a peach with XHTML</b></p>
|
|
Finally, one of the major changes to traditional HTML coding requires that all standalone tags (elements that do not require end-tags) be modified with a termination character, as follows:
|
Incorrect: <img src=”sadface.jpg”><br>
Correct: <img src=”happyface.jpg” /><br />
|
|
A complete XHTML-compliant document would appear as follows:
|
<!DOCTYPE html PUBLIC “-//W3C XHTML 1.0 Transitional//EN” “DTD/xhtml1- transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>My Poem</title>
</head>
<body>
<p align=”center”>
Life can be swell,<br />
with <b>XHTML</b>.
</p>
<img src=”happyface.jpg” />
</body>
</html>
|
|
The above samples illustrate only some of the coding rules enforced by XHTML. The slightest violation of these rules will result in a validation error, preventing the Web page from being displayed. In addition to the obvious benefits of having all Web page syntax consistently coded and structured, this framework requires XHTML parsing engines to do less work than traditional HTML parsers (which were designed to compensate for inconsistent HTML coding), and as a result reduces the footprint and processing requirements for Web pages and user interfaces. This opens up the use of XHTML (through the XHTML Basic subset) to mobile and other non-browser devices with more restrictive system requirements (hence achieving the W3C’s objective of providing portability).
|
|
Also worth mentioning is the emergence of the XHTML 1.1 specification, which trims the presentation tag feature set even more by dropping support for previously deprecated elements and attributes, again placing more emphasis on the use of CSS. Finally, an XML Events specification is being developed (currently a W3C working draft), which promises to integrate XHTML behaviours with DOM event interfaces. (A “basic” version of the XML Events specification is also being drafted.)
|
Even though the XHTML 1.0 specification achieved W3C recommendation status over a year ago, industry adoption of XHTML may be slow, due to the amount of coding changes required for existing HTML content to conform. It is anticipated that the introduction of mass HTML-to-XHTML conversion tools will become available to accelerate the acceptance rate of XHTML into the mainstream. Either way, it is likely inevitable that XHTML will eventually become the Web’s next global standard presentation language.
|
|
|