XML

Adding Structure to the Web with XHTML

One form of temptation many web developers have been unable to resist is that of hacking together web pages with poorly coded HTML. Fortunately, XML is well on its way to adding some much needed structure to the Web by ushering in a new version of HTML called XHTML, which represents a merger of XML and HTML.

Considering that there is a lot of confusion surrounding the relationship between XML and HTML, XHTML often serves only to muddy the water in terms of how people perceive XML. XHTML is ultimately quite simple in that it is a version of HTML reformulated to meet the strict structural and syntax requirements of XML.

XHTML makes use of the same elements and attributes as HTML, but it enforces XML rules, such as quoting all attribute values and requiring empty elements to end with />. It still isn't clear if, how, or when the Web will officially transition from HTML to XHTML, but it is a likely prospect given the benefits of XML. This tutorial introduces you to XHTML and examines some of the consequences of migrating web pages from HTML to XHTML.

In this tutorial, you'll learn

  • What XHTML is and why it was created
  • About the differences between XHTML and HTML
  • How to create and validate XHTML documents
  • How to convert existing HTML documents to XHTML