Mine verify doctypes and even convert from a doctype to another (for instance from html 4.01 transitional to strict, or to xhtml 1.0 strict, etc). It also corrects character encodings IIRC.
Tidy does some nice things, but it doesn't do the checks that the W3C validator does - it's not doing a full parse of the HTML based on the docs.
For example the W3C Markup Validation Service will catch the error in this broken XHTML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-s
+trict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>A random test file</title>
</head>
<body>
<P>Oops - XHTML tags must be in lower case</p>
</body>
</html>
but tidy thinks it's fine:
% tidy -e test.html
Info: Doctype given is "-//W3C//DTD XHTML 1.0 Strict//EN"
Info: Document content looks like XHTML 1.0 Strict
No warnings or errors were found.
To learn more about HTML Tidy see http://tidy.sourceforge.net
Please send bug reports to html-tidy@w3.org
HTML and CSS specifications are available from http://www.w3.org/
Lobby your company to join W3C, see http://www.w3.org/Consortium
I'm not saying tidy isn't useful. It's a great tool from basic checks and fixes on HTML. But it doesn't validate (X)HTML.
|