Solid Fluid System Solutions  
Home Software About Hardware Firmware
Document Icon 1. Introduction
Document Icon 2. Controlling Validation
Current Document Icon 3. Using Validation
Document Icon 4. Using Formatting

Using HTML Validation

When requested as described previously, the parser reads the HTML supplied to it as a browser would. It checks both the syntax and semantics of the document against fixed rules derived from the W3C recommendations on HTML. A summary report is generated in an output toolpane. Errors and warnings are marked by filename, character position and line (where possible). The report in the toolpane is clickable, such that it is easy to find the position in the document where an error occured.

An example of the output toolpane is given;

HTML validation toolpane

The text in the screenshot has been deliberately left difficult to read, we include an example below of an HTML file with some intentional errors, that demonstrate the validation engine capabilities.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>Solid Fluid - The home of dynamic technology</title>
  <style>
A {font: 10pt Arial; color: blue}
IMG {border: none}
  </style>
 </head>
 <body>
  <img src=""></img>
  <table align=center border="0" cellpadding="0" cellspacing="0">
<?php
 DoPage();
?>

 </body>
</html>

This erroneous HTML produces the following output;

Using: W3C HTML 4.01 Transitional & Frameset DTD merger
Parsing HTML syntax......
D:\Temp\test.html (15,12)=> (Error) Forbidden destructor.
:</img>
D:\Temp\test.html (2,18)=> (Error) Optional closed compulsory. Subsequent destructors ignored.
:</body>
Parse complete.
Dumping open tags......
D:\Temp\test.html (3,13)=> (Error) Tag not closed.
:table
Dump complete.
Validating HTML semantics......
D:\Temp\test.html (3,6)=> (Warning) The tag <style> did not have all of the following required attributes; "type".
D:\Temp\test.html (3,12)=> (Warning) The tag <img> is not valid as a child of <body>.
D:\Temp\test.html (3,12)=> (Warning) The tag <img> did not have all of the following required attributes; "alt","src".
D:\Temp\test.html (10,13)=> (Warning) Use of attribute "align" is deprecated on tag <table>.
Validation complete.
Checking HTML links......
Checking complete.
3 Error(s), 4 Warning(s), 0 Missing link(s)
Time elapsed: 406 ms.
Copyright © Solid Fluid 2007-2015
Last modified: SolFlu  Sat, 04 Jul 2009 22:18:35 GMT