Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Wanted, more simple tutorials on testing

by wazoox (Prior)
on Jul 23, 2005 at 14:49 UTC ( #477483=note: print w/replies, xml ) Need Help??


in reply to Re: Wanted, more simple tutorials on testing
in thread Wanted, more simple tutorials on testing

Better than that, there's HTML-Tidy. It's basically the same as the w3c validator, but much faster, and offline : you don't have to make your file accessible to the whole net :) It even can correct most common mistakes (unclosed tags, deprecated tags, unencoded entities, bad encoding...)

Get it there : HTML Tidy project
  • Comment on Re^2: Wanted, more simple tutorials on testing

Replies are listed 'Best First'.
Re^3: Wanted, more simple tutorials on testing
by adrianh (Chancellor) on Jul 24, 2005 at 11:14 UTC
    Better than that, there's HTML-Tidy. It's basically the same as the w3c validator,

    While tidy is certainly a useful app it is nothing like the W3C validator. It doesn't do verification against doctypes, doesn't recognise use of meta tags to set character encoding, etc.

      Hum, are we talking about the same app? 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.
        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.

Re^3: Wanted, more simple tutorials on testing
by ww (Archbishop) on Jul 25, 2005 at 13:18 UTC
    adrianh is completely correct; tidy (HTML) is an excellent tool for partial cleanup of bad (ie, non-w3c compliant) html and for pretty-fying code to make it easier to read when another author (or one of the less sensible WYSIWYG) has obfuscated the code... but it is NOT a validator.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://477483]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2020-05-29 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (169 votes). Check out past polls.

    Notices?