Re: Package Proposal: HTML_Sax
| From: | Alan Knowles | Date: | Sat, 10 May 2003 04:00:12 +0000 |
| Subject: | Re: Package Proposal: HTML_Sax | ||
| References: | 1 | Groups: | php.pear.dev php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16090@lists.php.net to get a copy of this message | ||
Can you make phps available please, I presume it's a hand based tokenizer/parser, I did a few of these before but was never very happy with them (they tended to break easily..), which is why I went down the road of using a lexer in flexy.. - which might worth breaking out as HTML_Lex one day..
Regards
Alan
Harry Fuecks wrote:
Hi, As a first effort towards PEAR, wondering if you're interested in this package; basically a SAX based parser for HTML and other badly formed XML documents. This could prove useful in solving a number of problems such converting HTML to XHTML and fixing other badly formed XML, parsing ASP.NET templates or even as part of a PHP-GTK web browser. The code is up here; http://www.phppatterns.com/index.php/filemanager/fileview/28/ This was originally a Python project of the same name which was ported to PHP here http://sourceforge.net/projects/phpshelve - I've spoken to the author of the PHP version (Alexander Zhukov) who is no longer maintaining it but has given me permission to use the PHP license instead of LGPL as was published on Sourceforge. I've made some modifications to Alexander's version to make the HTML_Sax API very similar to the native PHP XML extension (e.g. $parser-set_object($myHandler); and $parser->set_pi_handler('myPIHandler'); ) soit should be possible to use it which any class designed for the native XML extension as an alternative parser. I've also fixed some bugs and limitations and believe the code is now pretty stable - some basic unit tests are provided. Anyway - more detail in the download. Not so sure about the name. HTMLSax is fairly well known in Python I believe and I think the name conveys what it does but it may cause confusion with the existing PEAR::HTML_* classes which are more about rendering HTML. Changing the name in the code requires only a few minor modifications. Thanks, Harry