Skip to Main Content
Learning PHP, MySQL, and JavaScript
book

Learning PHP, MySQL, and JavaScript

by Robin Nixon
July 2009
Beginner content levelBeginner
526 pages
14h 24m
English
O'Reilly Media, Inc.
Content preview from Learning PHP, MySQL, and JavaScript

XHTML

I’ve used some elements of XHTML (eXtensible Hypertext Markup Language) already in this book, although you may not have realized it. For example, instead of the simple HTML tag <br>, I’ve been using the XHTML <br /> version. But what’s the difference between the two markup languages?

Well, not a lot at first glance, but XHTML improves on HTML by clearing up a lot of little inconsistencies that make it hard to process. HTML requires quite a complex and very lenient parser, whereas XHTML, which uses standard syntax more like XML (eXtensible Markup Language), is very easily processed with quite a simple parser—a parser being a piece of code that processes tags and commands and works out what they mean.

The Benefits of XHTML

XHTML documents can be quickly processed by any program that can handle XML files. As more and more devices such as iPhones and BlackBerries become web-enabled, it is increasingly important to ensure that web content looks good on them as well as on a computer’s web browser. The tighter syntax required by XHTML is a big factor in helping this cross-platform compatibility.

So what is happening right now is that browser developers, in order to be able to provide faster and more powerful programs, are trying to push web developers over to using XHTML, and the time may eventually come when HTML is superseded by XHTML—so it’s a good idea to start using it now.

XHTML Versions

The XHTML standard is constantly evolving, and there are a few versions in use:

XHTML 1.0

This ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Web Database Applications with PHP and MySQL, 2nd Edition

Web Database Applications with PHP and MySQL, 2nd Edition

Hugh E. Williams, David Lane
Learning PHP

Learning PHP

David Sklar

Publisher Resources

ISBN: 9780596803605Supplemental ContentErrata Page