Web Standards in Dreamweaver Part 3 - Validating the Document
(Page 3 of 12 )
After creating any layout, particularly if you are going to create multiple pages based on the same layout, it is a good idea to validate it before continuing. Dreamweaver has its own validator to make this easy. Before using the validator, make sure you checked XHTML 1.0 Transitional to validate against in Edit -> Preferences -> Validator. To run the validator, open the Results panel and click the small green arrow shown in Figure 2-29.
Figure 2-29. Dreamweaver’s validator
You can also validate your document by selecting File -> Check Page -> Validate Markup (for HTML) or File -> Check Page -> Validate as XML (for XHTML).
You can choose to validate the current document, the entire site, or just selected files in the site. The validator preferences can also be set here. The document should validate as XHTML 1.0 Transitional without needing to be edited by hand.
Using the W3C Validator
Although the internal validator is a useful tool when working on your documents within Dreamweaver, validating at the W3C makes a good final check. The URL for the W3C HTML validator is http://validator.w3.org
The W3C tool allows you to validate by entering the URL of the page that requires validation or by uploading the document. The easiest way to validate your pages is to FTP them to your web site and then enter the URL into the appropriate box at the validator. If you are using the Dreamweaver validator as you work on your site, you will probably only need to check with the W3C validator as part of your final testing to ensure that all documents, including those that contain dynamic data, are valid.
Moving to XHTML Strict
The XHTML Transitional DTD allows the use of deprecated attributes that will be removed from future versions. The Strict DTD does not allow the use of these deprecated attributes.
To convert your document from the Transitional DTD to the Strict DTD, you must work in Code view. Dreamweaver MX creates XHTML Transitional markup in recognition of the fact that most developers still need to create pages that are backward compatible with older (before version 5) browsers. However, the changes you will need to make are relatively simple.
Change the Document Type Declaration
In Code view, change the DOCTYPE at the top of the page to this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
This chapter is from ASP.NET Web Development with Macromedia Dreamweaver MX 2004, by Costas Hadjisotiriou (Apress, 2004, ISBN: 1590593480). Check it out at your favorite bookstore today.
Buy this book now.