Validating Your XHTML Document

The W3C has a validator that you can use to check the validity of your XHTML document, and you can find this validator at http://validator.w3.org. To use the XHTML validator, you just enter the URI of your document and click the Validate This Page button. The W3C validator will check the document and give you a full report. Here's an example response:

 Congratulations, this document validates as XHTML1.0 Transitional!  To show your readers that you have taken the care to create an interoperable Web page, you may display this icon on any page that validates. Here is the HTML you could use to add this icon to your Web page:   <p>     <a href="http://validator.w3.org/check/referer"><img         src="http://validator.w3.org/images/vxhtml10"         alt="Valid XHTML 1.0!" height="31" width="88" /></a>   </p> 

In this case, the document I tested validated properly, and the W3C validator says I can add the official W3C XHTML 1.0 Transitional logo to the document. That logo appears in Figure 16-2.

Figure 16-2. The W3C transitional XHTML logo.

graphics/16fig02.gif

Actually, the W3C XHTML validator does not do a complete job: It doesn't check to see whether values are supplied for required attributes, for example, or make sure that child elements are allowed to be nested inside the particular type of their parents. However, it does a reasonably good job.

In the remainder of this chapter, I'm going to get to the actual XHTML programming, starting with the document element, <html> .



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net