RE: [PHP-CVS] cvs: php4 /ext/qtdom qtdom.c qtdom.h
| From: | Colin Viebrock | Date: | Thu, 16 Nov 2000 20:07:42 +0000 |
| Subject: | RE: [PHP-CVS] cvs: php4 /ext/qtdom qtdom.c qtdom.h | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-2645@lists.php.net to get a copy of this message | ||
> It seems like GNOME dom parser uses twice the amount of memory. I
> parsed a
> document containing:
> <doc name="test">
> </doc>
Just to speak from a practical point of view, the GNOME parser generally
doesn't deal with documents like the above too intuitively. Mainly because
it treats all the information outside of tags as a node.
If I'm parsing an XML data string, I generally run it through this first:
$xml = trim(preg_replace('/>\s+</m', '><', $xml));
.. which cuts the size of the resulting tree in half.
Of course, you have to be sure that the newlines are meaningless in your
data,
since:
<doc name="test">
</doc>
Is technically different than:
<doc name="test"></doc>
... but you get the idea. Whether this is a bug or feature of the GNOME
parser, someone else can elaborate. :)
- Colin