PHPackages                             php-xml/large-text-node - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-xml/large-text-node

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-xml/large-text-node
=======================

Handling large text nodes requires using low-end PHP API functions. This package provides a simple interface to write large text nodes to a resource so that memory usage is reduced to a minimum.

1.0.0(10y ago)1300MITPHPPHP &gt;=7.0

Since Jul 23Pushed 10y ago2 watchersCompare

[ Source](https://github.com/php-xml/large-text-node)[ Packagist](https://packagist.org/packages/php-xml/large-text-node)[ RSS](/packages/php-xml-large-text-node/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Large XML text nodes in PHP
===========================

[](#large-xml-text-nodes-in-php)

The more high end XML APIs of PHP (e.g. SimpleXML) have the disadvantage that they store the whole XML document in memory. Parsing large XML files is therefore not the easiest task.

This package is designed to read large text nodes in a memory friendly fashion, so that for instance base64 encoded files saved in XML text nodes can be written to a file.

Selecting text nodes
--------------------

[](#selecting-text-nodes)

To read the contents of a text node, a **path** must be provided. To keep things simple, a path is just a list of tag names separated by a forward slash `/`. Currently only the first match in the XML document is returned.

For instance, the path `"document/tag/name"` would match the `I am matched` text node.

```

        I am matched

        I am skipped

```

Examples
--------

[](#examples)

To give you an idea, see the following examples

### Reading a large XML file

[](#reading-a-large-xml-file)

```
