Tidy & PHP5

php.internals

Ilia A.

22 years ago
I would like to propose that tidy extension be bundled with PHP 5. First of all it'll provide an easy means to validate and/or fix HTML input for webforms, which can also help existing functions such as strip_tags(). The extension can also be used to reduce HTML output by removing formatting, which can be quite significant for large pages (even if compression is used). Tidy can also be used to provide a rapid means for conversion between HTML and XHTML and if needed can even handle XML. To those who need to parse HTML it also provides a fairly handy OO API (similar to that of simplexml), which would enable people to write fast HTML parsers in PHP. Ilia

Edin Kadribasic

22 years ago
On Monday, Dec 1, 2003, at 14:45 Europe/Copenhagen, Ilia Alshanetsky wrote:
> I would like to propose that tidy extension be bundled with PHP 5. > > First of all it'll provide an easy means to validate and/or fix HTML > input for > webforms, which can also help existing functions such as strip_tags(). > The > extension can also be used to reduce HTML output by removing > formatting, > which can be quite significant for large pages (even if compression is > used). > Tidy can also be used to provide a rapid means for conversion between > HTML > and XHTML and if needed can even handle XML. To those who need to > parse HTML > it also provides a fairly handy OO API (similar to that of simplexml), > which > would enable people to write fast HTML parsers in PHP.
Sounds like a useful thing for many typical PHP applications, so +1 from here. Edin

Wez Furlong

22 years ago
+1 from me; very useful for screen scraping as well as validation and fixing. --Wez. ----- Original Message ----- From: "Ilia Alshanetsky" <ilia@prohost.org> To: "PHP Internals" <internals@lists.php.net> Sent: Monday, December 01, 2003 1:45 PM Subject: [PHP-DEV] Tidy & PHP5
> I would like to propose that tidy extension be bundled with PHP 5. > > First of all it'll provide an easy means to validate and/or fix HTML input
for
> webforms, which can also help existing functions such as strip_tags(). The > extension can also be used to reduce HTML output by removing formatting, > which can be quite significant for large pages (even if compression is
used).
> Tidy can also be used to provide a rapid means for conversion between HTML > and XHTML and if needed can even handle XML. To those who need to parse
HTML
> it also provides a fairly handy OO API (similar to that of simplexml),
which

Moriyoshi Koizumi

22 years ago
+1 if this is counted :) Moriyoshi On 2003/12/01, at 22:45, Ilia Alshanetsky wrote:

John Coggeshall

22 years ago
> I would like to propose that tidy extension be bundled with PHP 5.
Uhh... +1 from me, too. :) John

epplestun

22 years ago
+1 there are ... a lot :-) ----- Original Message ----- From: "John Coggeshall" <john@coggeshall.org> To: "PHP Internals" <internals@lists.php.net> Sent: Monday, December 01, 2003 4:31 PM Subject: Re: [PHP-DEV] Tidy & PHP5

Georg Richter

22 years ago
> I would like to propose that tidy extension be bundled with PHP 5.
+1 Georg

Thies C. Arntzen

22 years ago
before bundling i'd like to see the api refined... right now it's not possible to work with more than one html-doc at a time. (tidy_parse_file() does not return a resource to the internal tidy doc, so you can only have one doc at a time) also we should ask ourself if (i haven't used tidy so i might be wrong) we want tidy to expose a similar API as SimpleXML does (which we all seem to like - be it too magic or not) re, tc Am 01.12.2003 um 18:39 schrieb Georg Richter:

John Coggeshall

22 years ago
In the primary use of tidy (which is to validate HTML), there is very little need for a returned resource other than to clutter the namespace. Unlike most extensions, where it would be useful imo the resource is unnecessary. Since we can reuse the container for the tidy documentation, it's much faster to just perform serial operations for the general case then it is to reallocate a brand new container every time for no reason. As far as the API itself goes for the OO side of things, I think the API that is exposed is just fine. Just as is the case with any screen-scraping tool, the problem is not in the tool but in the document you are scraping (trying to find that table you want buried in the document). John On Mon, 2003-12-01 at 12:46, Thies C.Arntzen wrote:

Georg Richter

22 years ago
> before bundling i'd like to see the api refined... > > right now it's not possible to work with more than one html-doc at a > time. (tidy_parse_file() does not return a resource to the internal > tidy doc, so you can only have one doc at a time)
Yes, Thies is right here! But s/resource/object :) I don't know the tidy api very well, but wouldn't be the normal way to have an object for a Document (which was created by tidyCreate) instead to use a global value for? So you can work with multiple documents, and you also can add additional (userland) functionality. This would be the "normal" behaviour for new php5 extensions (simplexml, sqlite, mysqli, mono, ...). Just my 0,024$ Georg

Marcus Börger

22 years ago
Hello Georg, Monday, December 1, 2003, 10:11:10 PM, you wrote:
>> before bundling i'd like to see the api refined... >> >> right now it's not possible to work with more than one html-doc at a >> time. (tidy_parse_file() does not return a resource to the internal >> tidy doc, so you can only have one doc at a time)
> Yes, Thies is right here! But
> s/resource/object :)
> I don't know the tidy api very well, but wouldn't be the normal way to have an > object for a Document (which was created by tidyCreate) instead to use a > global value for? So you can work with multiple documents, and you also can > add additional (userland) functionality. This would be the "normal" behaviour > for new php5 extensions (simplexml, sqlite, mysqli, mono, ...).
I had the idea of a tidy wrapper long ago too. So i am +1 But i also would like to see it with an object (php 5) api and i'd like to see an output handler, too.
-- Best regards, Marcus mailto:helly@php.net

Derick Rethans

22 years ago
On Mon, 1 Dec 2003, Ilia Alshanetsky wrote:
> I would like to propose that tidy extension be bundled with PHP 5.
I'm -1 on this until the API gets cleaned up so that it either makes 1) use of resources or 2) objects instead of polluting the global scope with document and related settings. Derick