On Sunday 02 February 2003 23:36, Paul Makepeace wrote:
> I'm trying to decide on the best way of checking small fragments of HTML
> for well-formedness, i.e. catching overlapping tags, missing end tags,
> etc. Nothing fancy, just an aid when inputting HTML in a form.

I've been using the some code to check whole trees of html  it uses 
OpenJade[1] as its parser and has the OpenSP tools to help ... you might like 
to take a look at that.  By simply wrapping your suspect code in a suitable 
HTML doc type you can then validate it against whicever DTD in the catalogue 
you require /// 

 infact I would have thought the w3c validator[2] which also uses 
Jade/OpenJade and OpenSP ... it  does almost *exactly* what you want (it has 
a option for file upload, replace that with a textfield and and then wrap it 
in an HTML doctype)... and it produces a human readable output ... I would 
have thought minimal hacking of that would have got you exactly what you need.

[1]http://openjade.sourceforge.net
[2]http://validator.w3.org
-- 
Robin Szemeti

Reply via email to