on 09/17/2009 06:33 AM Dušan Novaković said the following:
> I have few questions about validation XHTML and repairing if it's
> broken. The problem is that I have some, for example HTML code (simple
> web page) and want to load that page to DOMDocument and than make
> something of it. That part works perfect, but if there is unclosed tag
> or something like that when I try to load that page I get an error
> because now that code is not valid. So my question would be, is there
> some way that I could build some script in php that would run thought
> that page and check if it's valid or not, and if it's not than try to
> repair it. Something that you have in all tools, for example Eclipse,
> NetBeans, etc. If anyone have any idea, please help me, because I'm
> stuck in here :-(

You may want to try this HTML parser package. It is tolerating to
malformed HTML documents. It returns a stream of document elements, such
as tags, data, character entities, etc.. that you can pass back to the
class and regenerate a well-formed document. It comes even with filter
class that validates the document against a DTD and adds missing closed
tags and such.



Manuel Lemos

Find and post PHP jobs

PHP Classes - Free ready to use OOP components written in PHP

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to