Web Page Validation and Code Testing
Validation only checks the code for adherence to industry standards; it does not assure that the code is written efficiently. There are still numerous ways that XML and HTML code can be inefficiently constructed, yet still comply with industry standards. Nonetheless, if there are errors in Web page code, browsers may repeatedly re-render the page, which slows the overall rendering process. A validator identifies numerous common coding errors, such as improper tag nesting and invalid attributes. It is therefore very worthwhile to validate the code and make the recommended corrections to assure compliance.
Online validation tools
The W3C (World Wide Web Consortium) is the international organization that maintains the coding standards for HTML, XHTML, CSS and other Web scripting languages. They have an on-line HTML/XHTML validator that is considered to be the gold standard for testing.
The W3C validator is found here: W3C Markup Validation Service.
Use of the validator requires the inclusion of a proper Document Type Declaration (DTD or Doctype) at the top of each Web page. A Doctype declaration tells the validator which version of HTML or XHTML you are using and establishes the standard for validation. The validator may not work without a Doctype declaration.
Many Web site designers and developers skip the use of the Doctype, but it should used on every page. The Doctype also tells a browser which version of HTML or XHTML is used, which helps assure proper rendering of the pages based upon the standard you select. Without a Doctype, Web pages can sometimes display differently than intended. Internet Explorer, for example, contains multiple rendering engines that can display a Web page differently if a standard is not declared. The W3C maintains Doctype declaration standards, which can be found here: List of valid DTDs
The most common HTML DTD is HTML 4.01 Transitional. The most common XHTML DTD is XHTML 1.0 Transitional. With static HTML or XHTML pages, the DTD must be the first line of code in your script. The DTD is client-side code, so if you use ASP, PHP or other dynamic languages, the DTD needs to be the first line of code sent to the browser, which is not necessarily the first line of code in your script. If you do not understand the last sentence, then you are using static HTML pages and the DTD must be the first line of code.
There are two ways to use the validation service. First, you can go to the W3C Markup Validation Service page listed above and enter a URL for the page you wish to validate. The alternative is to include a snippet of HTML code on your Web page that activates the validator and submits a page automatically when a button or hyperlink is clicked. Once a page is successfully validated, the following code (or an HTML version) is offered by the W3C validator.
<a href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a>
The code can be included on your Web page and will display a clickable icon that submits the page automatically. I use an alternative code that displays as a link on the bottom of each Web page and serves the same purpose. To see how this works, just click on the XHTML 1.0 link at the bottom of this page.
Other free online testing and validation tools
Web Page Analyzer Web Page Analyzer calculates page size (page weight) and page download time.
Spider Test This tool checks a Web page for ’spiderability’ and recommends changes that may be necessary to make
it easier for search engine algorithms to index a site.
Good luck with your testing.
.





