Re: A question about Tidy's validate

Bjoern Hoehrmann <[email protected]> Sat, 05 Jan 2013 13:17:03 +0100
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
* Liu hf wrote:
>document, errors =3D tidy_document('''
><html>
><head>
><p>dfdfdfd
></httml/>
>''')
>print document
>print errors
>
>It is a incorrect html code , but when I  run it  , tidy fixed  the mistake
>automatically and did not print any error :

>line 2 column 9 - Warning: missing <!DOCTYPE> declaration
>line 4 column 25 - Warning: inserting implicit <body>
>line 5 column 9 - Warning: discarding unexpected </httml>
>line 3 column 17 - Warning: inserting missing 'title' element
>
> I hope that tidy will print the errors when it is find the error
>as unclosed tags, missing elements  . Would you like to tell me how to do
>it ?  thank u  so much  .

HTML Tidy emits "Errors" when it encounters something where it is not
sure it can properly repair or at least process it without loss of in-
formation. You could read the Warnings as indicating something invalid,
but some warnings deal with problems other than validity, and for some
things you might not get even a warning. In short: HTML Tidy does not
try to be a Validator and if you need a Validator you should use some
other tool.
-- =

Bj=F6rn H=F6hrmann =B7 mailto:[email protected] =B7 http://bjoern.hoehrma=
nn.de
Am Badedeich 7 =B7 Telefon: +49(0)160/4415681 =B7 http://www.bjoernsworld.de
25899 Dageb=FCll =B7 PGP Pub. KeyID: 0xA4357E78 =B7 http://www.websitedev.d=
e/ =


---------------------------------------------------------------------------=
---
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912