Req #44761 [Com]: DOM & Large Files
| From: | clicky at erebot dot net | Date: | Fri, 14 Oct 2011 15:27:16 +0000 |
| Subject: | Req #44761 [Com]: DOM & Large Files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-164325@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=44761&edit=1
ID: 44761
Comment by: clicky at erebot dot net
Reported by: xwisdom at yahoo dot com
Summary: DOM & Large Files
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: Windows XP
PHP Version: 5.2.5
Block user comment: N
Private report: N
New Comment:
The DOM extension is meant explicitely to handle small XML files as it requires a copy of the file
being processed and a large number of objects be kept in memory (this is also true for the SimpleXML
extension which is based on the same underlying parsing library).
If you need a faster alternative, I'd suggest you take a look at the XMLReader and XML Parser
extensions (http://php.net/manual/en/book.xmlreader.php and http://php.net/manual/en/book.xml.php,
respectively).
XMLReader works by using a cursor-based parsing approach, while XML Parser uses a push-based
approach.
Here are some drawbacks though when using these extensions:
- validation may not be possible (true XML Parser)
- you can't use XPath to browse through the data (true for both extensions)
Hope this helps.
Previous Comments:
------------------------------------------------------------------------
[2008-04-17 14:34:45] xwisdom at yahoo dot com
Description:
------------
I think the (X)HTML DOM features are great but I would like for it to process the DOMDocument much
faster.
It appears that the HTML DOM features in php are not able to handle large html files (200k+).
It's slow down when processing these files.
I would like to request that the DOM processing objects be given a speed boost. The DOM that's
present in the browsers are much faster at processing the element. If this can be done then it would
be great!
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=44761&edit=1