PHPackages                             hakre/xmlreaderiterator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. hakre/xmlreaderiterator

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

hakre/xmlreaderiterator
=======================

Iterators for PHP XMLReader for ease of parsing

v0.1.12(3y ago)60208.0k—7.1%15[4 PRs](https://github.com/hakre/XMLReaderIterator/pulls)1AGPL-3.0-or-laterPHP

Since Aug 31Pushed 2y ago2 watchersCompare

[ Source](https://github.com/hakre/XMLReaderIterator)[ Packagist](https://packagist.org/packages/hakre/xmlreaderiterator)[ Docs](https://github.com/hakre/XMLReaderIterator)[ RSS](/packages/hakre-xmlreaderiterator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (12)Used By (1)

Iterators for [PHP `XMLReader`](http://php.net/XMLReader) for Ease of Parsing
-----------------------------------------------------------------------------

[](#iterators-for-php-xmlreader-for-ease-of-parsing)

### Change Log:

[](#change-log)

- `0.1.12` maintenance release with fixes.
- `0.1.11` maintenance release with fixes. added `XMLReader::CDATA` and `XMLReader::WHITESPACE` node support for `XMLWritingIteration`. added `XMLReaderItertor::skipNextRead()` for nested iterations.
- `0.1.10` maintenance release with fixes.
- `0.1.9` maintenance release with fixes. added `XMLReaderNode::expand()`.
- `0.1.8` maintenance release with fixes.
- `0.1.7` maintenance release with fixes.
- `0.1.6` maintenance release with fixes. added xml-file-scanner command-line tool example.
- `0.1.5` maintenance release with tests and new `XMLReaderNextIteration`to iterate in `XMLReader::next()` fashion.
- `0.1.4` maintenance release with fixes.
- `0.1.3` added `XMLSequenceStream`, a PHP stream wrapper to read XML from files which are a sequence of XML documents. Works transparently with `XMLReader`.
- `0.1.2` added `XMLWritingIteration`, an iteration to write with `XMLWriter` from `XMLReader`.
- `0.1.0` composer support has been added.
- `0.0.23` first try of a compatibility layer for PHP installs with a libxml version below version 2.6.20. functions with compatibility checks are `XMLReaderNode::readOuterXml()`and `XMLReaderNode::readString()`.
- `0.0.21` moved library into new repository and added `XMLReaderAggregate`.
- `0.0.19` added `XMLElementXpathFilter`, a `FilterIterator` for `XMLReaderIterator` by an xpath expression.

    ```
    $reader = new XMLReader();
    $reader->open($xmlFile);
    $it = new XMLElementIterator($reader);

    $list = new XMLElementXpathFilter(
        $it,
        '//user[@id = "1" or @id = "6"]//message'
    );

    foreach($list as $message) {
        echo " * ",  $message->readString(), "\n";
    }
    ```

### Stackoverflow Q&amp;A for the XMLReader Iterators

[](#stackoverflow-qa-for-the-xmlreader-iterators)

the latest on top (for more examples, checkout the [`examples`](https://github.com/hakre/XMLReaderIterator/tree/master/examples) folder):

- [Add Tag Element using XMLReader and SimpleXML or XMLWriter](https://stackoverflow.com/q/69455574/367456)
- [How to distinguish between empty element and null-size string in DOMDocument?](http://stackoverflow.com/a/24109776/367456)
- [PHP XML parser: How to read only part of the XML document?](http://stackoverflow.com/a/15443517/367456)
- [Parse XML with PHP and XMLReader](http://stackoverflow.com/a/15351723/367456)
- [Getting XML Attribute with XMLReader and PHP](http://stackoverflow.com/a/15399491/367456)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~581 days

Recently: every ~678 days

Total

6

Last Release

1369d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/378849?v=4)[hakre](/maintainers/hakre)[@hakre](https://github.com/hakre)

---

Top Contributors

[![hakre](https://avatars.githubusercontent.com/u/378849?v=4)](https://github.com/hakre "hakre (16 commits)")

---

Tags

xmliteratorXMLReader

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hakre-xmlreaderiterator/health.svg)

```
[![Health](https://phpackages.com/badges/hakre-xmlreaderiterator/health.svg)](https://phpackages.com/packages/hakre-xmlreaderiterator)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[sabre/xml

sabre/xml is an XML library that you may not hate.

52832.2M131](/packages/sabre-xml)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[dkrnl/simplexmlreader

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

112951.5k](/packages/dkrnl-simplexmlreader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
