Re: cvs: php4 /ext/qtdom qtdom.c qtdom.h
| From: | Bård Farstad | Date: | Thu, 16 Nov 2000 20:55:29 +0000 |
| Subject: | Re: cvs: php4 /ext/qtdom qtdom.c qtdom.h | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-2644@lists.php.net to get a copy of this message | ||
>PHP simply because it fixes a single bug in a current working extension
It's not fixing a bug. It's an alternative implementation using a more robust
parser.
Why are there both perl and POSIX extended regular expressions in PHP then?
Probably so the user can choose which one to use.. ( okay, the perl regexps
are better. But who am I to judge ? )
>at least not until every other option has been exhausted.
Ok, then someone please fix the xmltree() function to parse valid XML
documents. If noone can fix the parser I say the parser don't work and should
not be a part of PHP:)
Personally I don't have time to fix bugs in a XML parser.
>Perhaps its an easy fix in libxml itself, perhaps you
>might be doing something wrong in the setup, and perhaps, your right,
>libxml currently does not support it, perhaps the next release of libxml
>will, then what?
The user can still decide which to use. And that's the power of Open Source !
>If QtDOM offered some signifigant new functionality, a
>much faster parser, or something else I could perhaps see the rationale in
>adding it, but as it is, I think it might be better to distribute QtDOM
>separately from PHP
What about memory usage:
It seems like GNOME dom parser uses twice the amount of memory. I parsed a
document containing:
<doc name="test">
</doc>
and the results of a print_r() on the returned document:
----------- begin output
XML parser test:
qt did fine:
QDomDocument Object
(
[version] => 2.2.2
[type] => 1
[children] => Array
(
[0] => QDomNode Object
(
[name] => doc
[type] => 1
[attributes] => Array
(
[0] => QDomNode Object
(
[name] => name
[type] => 2
[content] => test
)
)
)
)
)
gnome did fine:
DomDocument Object
(
[version] => 1.0
[standalone] => -1
[type] => 9
[children] => Array
(
[0] => DomNode Object
(
[name] => doc
[type] => 1
[attributes] => Array
(
[0] => DomAttribute Object
(
[name] => name
[children] => Array
(
[0] => DomNode Object
(
[name] => text
[type] => 3
[content] => test
)
)
)
)
[children] => Array
(
[0] => DomNode Object
(
[name] => text
[type] => 3
[content] =>
)
)
)
)
[root] => DomNode Object
(
[name] => doc
[type] => 1
[attributes] => Array
(
[0] => DomAttribute Object
(
[name] => name
[children] => Array
(
[0] => DomNode Object
(
[name] => text
[type] => 3
[content] => test
)
)
)
)
[children] => Array
(
[0] => DomNode Object
(
[name] => text
[type] => 3
[content] =>
)
)
)
)
------------------------------ end output
As you can see, the QDOM parser is less memory hungry.
--
Bård Farstad
System developer
eZ systems as
http://www.ez.no