The XML::LibXML family might work for you. You need to parse the DTD -- XML::LibXML::Dtd -- and apply it against the document. $doc->validate($dtd)
I'm not sure how well this works but I often use XML::LibXML for parsing XHTML fragments as a cheap well-formedness validation. If it parses, it's well-formed (though not necessarily correct XHTML). Sorry I don't have a snippet for you.
Update: I just tried a test and it looks like straight $doc->validate() and the non-fatal $doc->is_valid() work fine against the DTD declared in the document. I think you only have to pass it the DTD if you want to apply an external/custom set of rules to the document.
In reply to Re: HTML::Tidy question
by Your Mother
in thread HTML::Tidy question
by megaurav2002
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |