• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL




If you've been on the Web for more than just a few minutes, you've probably heard about HTML. It's so pervasive that it's discussed frequently on television, and not just as an answer in a quiz show! Story lines in comedies include characters having their own Web sites. You hear "www-dot-something-dot-com" in nearly every radio advertisement. HTML is showing up in résumés outside the realm of tech workers—it's become mainstream. But you know that the Web is continuing to grow: XML, the Extensible Markup Language, is the buzzword in the halls of business today. XHTML, the Extensible Hypertext Markup Language, bridges the two worlds: HTML to XML.

What's the By Example Advantage?

There are two distinct advantages in learning XHTML when it's done By Example. First, by completing the examples as you read through each chapter, the concepts are reinforced for you immediately; much more so than just reading about a technique.

Second, with the XHTML examples that will be available for download from the Web, XHTML by Example gives you a great position on the cutting edge of Web development, all while allowing you to practice your new skills on today's sites. How? As you work through the examples, you can edit them to suit your immediate needs, letting you have up a working XHTML-based Web site in minutes!

Who Should Use This Book?

Most readers of this book will have some experience in writing HTML Web pages. The root of many concepts presented in Part I, "Learning XHTML," will be familiar to you through your work in HTML. You'll gain a reinforcement of your current knowledge, along with the expanded skills that come with the extension into XHTML.

Even if you've only dabbled in HTML, XHTML by Example provides sufficient information for you to begin your learning right here.

For all readers, you'll tour the exciting new efforts underway at the W3C that will enhance interoperability between devices, markup languages, and the custom needs of businesses, vertical markets, and public interest groups.

Why Should You Learn XHTML?

The World Wide Web has continued its record-breaking growth, and has become an integral part of modern life. On the job, it's not just programmers or technical staff that are producing Web sites: marketing personnel, administrative assistants, teachers, managers—almost any job imaginable—also can be responsible for a segment of the company Web site. Outside the workplace, families and friends stay connected through the Web. We store our calendars and address books online, make travel arrangements, buy tickets to entertainment venues, and do our Christmas shopping online. Knowing how to create and maintain these pages allows you to keep pace on the job and at home—with very little effort!

By working with XHTML in creating these Web pages, you'll be fully poised to integrate the XML-based documents and data stores that your company is developing or that your bank, creditors, or correspondents are using to streamline business processes.

What Tools Do You Need?

The only tools you'll need—besides your computer of course—is your favorite text editor and a Web browser. No special software is required to write XHTML. Windows users can use Notepad, Macs come with SimpleText, and many Unix users will be familiar with VI or Emacs. You can certainly use a more advanced editor, such as TextPad, Programmer's File Editor (PFE), or even specialized tools such as HomeSite, but nothing more than a basic editor is required.

XHTML is new enough that the visual Web tools haven't yet caught up. When they do, you might want to experiment with them. By that time, you'll have a solid grasp on creating XHTML by example, and will be able to evaluate the effectiveness of these tools.

As I mentioned previously, you will need a Web browser package or two for viewing and critiquing your own documents. I strongly recommend having both Microsoft Internet Explorer and Netscape Navigator available, as well as an "alternative" browser or two such as Opera or Lynx. You won't necessarily need an Internet connection while working through this book, but having one will allow you to visit the sites mentioned throughout the text and to download the sample code that will be available on the publisher's Web site. To get there, browse to http://www.mcp.com/detail.cfm?item=0789723859.

How This Book Works

Each chapter in this book begins by explaining a particular concept, giving examples in short sections of XHTML markup as you go along. After you've mastered the concept, you'll be ready to work with a full-fledged example. I encourage you to type in each of the examples, as the act of creation will reinforce the concepts that you've just read. Some of the examples also will suggest that you modify the text to make it more suitable for your personal use. When you're done, you can test and view the documents in your Web browser.

The key to the organization of this book is simple: It's progressive. You'll start out simply, by going over the fundamental concepts of XHTML and creating basic pages. From there, you'll begin working with XML concepts such as DTDs, schemas, and XML-based style sheets, and move on to the projects still being discussed at the W3C: modularization, document and device profiles, and more.

Overview of Chapters

This book is divided into logical parts and chapters to help you find the lessons that are most appropriate to your knowledge level. What follows is a description of each part of this book, including a look at each chapter.

Part I: Learning XHTML

Chapter 1, "XHTML Fundamentals," reviews the basic concepts involved in all XHTML documents. Chapter 2, "Adding Semantics to Structure," discusses the meaning that can be attached to structural elements through their use and presentation. Chapter 3, "Working with Images," walks you through the process of incorporating these popular features in your XHTML documents. Chapter 4, "Collecting Data with Forms," takes a close look at the process of retrieving input from your users. Chapter 5, "Working with Tables," guides you through the ins and outs of tabular content. Chapter 6, "Using Frames," highlights the features and cautions necessary when working with framed content. Chapter 7, "Universal Accessibility on the Web," discusses the concepts of universal design that allow access to content by those with physical limitations, as well as those browsing from devices with limited capabilities. Chapter 8, "Validating XHTML Documents," introduces you to the tools available to check the accuracy of your work, and finally Chapter 9, "Implementing XHTML Today," takes a look at how XHTML might be used in current browsers and on today's Web with very little effort!

Part II: XHTML Style and Structure

Chapter 10, "XHTML as the Bridge to XML," begins with an overview of the freedom that XML brings to markup and how you can begin to use it with XHTML. Chapter 11, "Using Cascading Style Sheets with XHTML," covers a quick review of CSS, and how it's integrated with XHTML. Chapter 12, "XSL—Style the XMLWay," discusses XSL, the Extensible Stylesheet Language. Chapter 13, "Document Type Definitions—The Syntax Rulebook," introduces you to the world of DTDs, where you define and use your own elements and attributes.

Part III: Modularization

Chapter 14, "XHTML Modularization," begins our look at the current work at the W3C, and the concepts that make XHTML so powerful: the ability to combine vocabularies. Chapter 15, "Creating a Custom XHTML Module," guides you through the process of defining your own elements and attributes that will be combined with the standard XHTML modules. Chapter 16, "Combining Custom Modules with XHTML," teaches you how to bind these modules together and use them as a new document type.

Part IV: The Future of XHTML

Chapter 17, "Subsetting XHTML: XHTML Basic," reviews an existing use-case for a subset of XHTML capabilities: the XHTML Basic DTD. Chapter 18, "XHTML Document Profiling," explores how authors can describe their documents in meaningful ways, to be cached, processed, or transformed according to the needs of various devices. Finally, Chapter 19, "Next Steps for XHTML," looks inside the plans of the broadcast community for incorporating XHTML in the broadcast stream, and ideas for embedding broadcast media on the Web itself.

Conventions Used in This Book

This books uses the following typeface conventions:

ItalicVariables in "pseudocode" examples and HTML terms used the first time
BoldText you type in
Computer typeCommands, filenames, and HTML tags, as well as URLs and addresses of Internet sites, newsgroups, mailing lists, and Web sites


Notes provide additional information related to a particular topic.


Tips provide quick and helpful information to assist you along the way.

The Other Advantage

In writing computer-oriented books, I've invested not only a significant amount of time and effort, but also a sincere hope that you, the reader, find the information here to be accurate, valuable, and helpful. But if I don't hear from you, it's difficult for me to know whether these goals were met. Therefore, I want you to let me know how I did by sending me email. I will take any question, concern, praise, or complaint you have about this book and its examples, errors, or anything else that comes up. I'll do my best to provide the correct answer or refer you to a place where you can find the information you need, or someone to ask who might have more experience in the given topic than I do. Please write to me at xhtml@webgeek.com.

It is very important to me that you are satisfied with everything you come across in this book. If you get through a chapter and are still having trouble with a concept, take a peek at the Web site I'll be maintaining for this book, to see if someone else has encountered the same problem. Updated bits of errata, and anything else related to questions and problems readers have had, will be posted there. You can find it at http://www.webgeek.com/books/xhtmlbyexample/. The most important thing to remember is that I don't want you wasting time on an error or on a concept that I might have explained poorly. So do look there or email me before you spend too much time hitting yourself over the head.

If you've created something that you're particularly proud of, drop me a line about that, too! I love to hear about my readers' success stories.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint