Re: Package Proposal: HTML_Sax
| From: | Christian Stocker | Date: | Sat, 10 May 2003 11:25:09 +0000 |
| Subject: | Re: Package Proposal: HTML_Sax | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16105@lists.php.net to get a copy of this message | ||
Just For your information
libxml2 is able to parse HTML documents and to produce SAX Events with it.
As sterling now made a libxml2 based sax interface, it shouldn't be a big
deal to support HTML Documents for SAX as well (domxml does it since quite
some time)
This does not say, that there shouldn't be a PHP based HTML_Sax class :)
chregu
On Sat, 10 May 2003, 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'); ) so
> it 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
>
>
--
nam...christian stocker adr...pflanzschulstr. 31, ch-8004 zurich
pho...+41 43 317 9984 www...http://blog.bitflux.ch
mob...+41 76 561 8860 ema...chregu@phant.ch
wor...+41 1 240 5670 gpg...0x5CE1DECB