Special Edition: Using HTML and XHTML, by Molly E. Holzschlag. New Riders, 2002, 700pp. US$39.99, CDN$62.99, UK£28.99
What? Another HTML book? Why would I want to read another one of those? That's a good question, and I have the answer. Several answers, in fact.
First off, HTML has changed, is changing, and will continue to change. The very fact that the book's title includes not just HTML but XHTML indicates that we are in a transitional period. One day, we'll be authoring web sites using XML, a markup language that has very strict syntax parameters and structural guidelines. Authoring in XHTML will prepare us for that level of stringency.
Second, because this one is by Molly Holzschlag. Molly is a web veteran, author of more than 20 books on web development, and, to top it off, is Associate Editor of Digital Web. Well, never mind that last part. Despite what every book jacket blurb says about its author, Molly is, in fact, an expert. She speaks often at web developer conferences, and sits on the steering committee of the Web Standards Project. Perhaps best of all, she's an experienced teacher.
Lastly, because this book, though part of what sounds like a generic series, really is different. This book is the first and only HTML reference that I've seen that puts web standards up front. Literally. The first chapters are entitled "Working with Specifications" and "Writing Conforming Documents." This author believes in the importance of well-formed and well-structured markup. And she tells us why.
Let's take a look at Chapter 4, "Choosing the Right DTD". In the early years, authors didn't bother to mention stuff like this. Browsers were so forgiving, we could just jump right in and start using tags. DTDs (or Document Type Definitions) have only become necessary as HTML has grown through several versions into XHTML.
A Document Type Definition is like a big laundry list of tags that are legal for an author to use. By defining which DTD you'll be using at the beginning of your document, you are declaring that your markup will be conforming to that particular list of tags. A document that fully conforms to the DTD is said to "validate," and Holzschlag spends some time discussing validation in Chapter 2. Though validation is required in XHTML, it is optional in HTML, though the author feels it is a good idea to write code that validates no matter what. It is better to learn to write markup that validates right from the beginning than to have to learn it later.
The DTD is declared in markup using the DOCTYPE declaration. In the past, browsers ignored this declaration but now browser makers are updating their rendering engines to be more standards-compliant. The newer browsers have two "modes": a "Strict" mode for pages with proper DOCTYPE declarations and a "Quirks" mode for pages which lack one. Holzschlag includes a handy chart to show how each browser assigns which mode to which DOCTYPE.
Until very recently, most people authoring web pages left out the DOCTYPE declaration or left unchanged the default value entered by their editor. It is definitely time to learn what the declaration means, since browsers now pay much more attention to it. Once you've seen the differences in how pages are rendered using "Quirks" mode and "Strict" mode, you'll want to pay attention too.
Another area covered by Holzschlag that is new to most books on HTML is XHTML Modularization. Chapter 19 covers this subject in detail, and provides a good introduction for forward-thinking designers.
The XHTML 1.1 DTD introduced the concept of modularization, which allows XHTML to accomodate a much larger range of devices than were previously supported. These include digital television, smart phones, handheld devices (PDAs), two-way pagers, car navigation systems, and even printers. Since each of these devices has their own limitations with regard to the display of information, it is necessary to customize our markup to make the best use of each device. Modularization allows authors to extend XHTML by writing new "modules" which fit into the two major categories. Abstract modules are collections of similar types of data, and are further subdivided into:
DTD Modules are subdivided as follows:
Between these two major types of modules, XHTML authors now have a fully extensible set of tools for authoring documents which will be viewable on any technology, present or even future.
One of the areas of extensibility of most interest is the ability to customize DTDs, and Holzschlag devotes an entire chapter (Chapter 20) to this exciting development.
It's become clear that web page authors must move beyond the current grab bag of hacks and workarounds and learn to write compliant and elegant markup. This book is an extremely useful reference and tool for that endeavour. More than just a reference, though, the book discusses real world issues ranging from browser quirks to client intransigence. Perhaps the most useful chapters are the ones I found most difficult. Very few authors of HTML books are delving into the issues surrounding XHTML modularization and DTDs and XSLT with the same gusto as Molly Holzschlag. For that, I am glad. These are heady days for people like us, some of whom learned HTML as a sort of extension to our word processing software. It's nice to have such a seasoned professional as our guide, as we become less like "authors" and more like "programmers."