Skip to content
Wrapped XMLReader class, for simple SAX-reading of huge xml.
Branch: master
Clone or download
dkrnl Update composer.json
Reading composer.json of dkrnl/simplexmlreader (master)
Skipped branch master, Invalid package information: 
License "Public Domain" is not a valid SPDX license identifier, see if you use an open license.
If the software is closed-source, you may use "proprietary" as license.
Latest commit 937ffa1 Feb 14, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples add xpath query support Nov 11, 2013
library Add 'preserveWhiteSpace' boolean flag Aug 18, 2016
autoload.php Update autoload.php May 12, 2015
composer.json Update composer.json Feb 14, 2018 Update Mar 18, 2016

Simple XML Reader

Wrapper XMLReader( class, for simple SAX-reading(and simple XPath-queries) of huge(testing over 1G file) xml.

Minimum the memory usage of other xml libraries(SimpleXML, DOMXML).

Usage example 1:

$reader = new SimpleXMLReader;
$reader->registerCallback("by-node-name", function($reader) {
    $element = $reader->expandSimpleXml(); // copy of the current node as a SimpleXMLElement object
    $attributes = $element->attributes(); // read element attributes
    /* ... */
$reader->registerCallback("/by/xpath/query", function($reader) {
    $element = $reader->expandDomDocument(); // copy of the current node as a DOMNode object
    $attributes = $element->attributes(); // read element attributes
    /* ... */

Usage example 2:

License: Public Domain

You can’t perform that action at this time.