PHPackages                             zendframework/zendxml - 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. [Security](/categories/security)
4. /
5. zendframework/zendxml

Abandoned → [laminas/laminas-xml](/?search=laminas%2Flaminas-xml)ArchivedLibrary[Security](/categories/security)

zendframework/zendxml
=====================

Utility library for XML usage, best practices, and security in PHP

1.2.0(7y ago)309.1M↓14.3%1120BSD-3-ClausePHPPHP ^5.6 || ^7.0

Since Mar 5Pushed 6y ago9 watchersCompare

[ Source](https://github.com/zendframework/ZendXml)[ Packagist](https://packagist.org/packages/zendframework/zendxml)[ RSS](/packages/zendframework-zendxml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (8)Used By (20)Security (1)

ZendXml
=======

[](#zendxml)

> ## Repository abandoned 2019-12-31
>
> [](#repository-abandoned-2019-12-31)
>
> This repository has moved to [laminas/laminas-xml](https://github.com/laminas/laminas-xml).

[![Build Status](https://camo.githubusercontent.com/8a3ad56d8e3b363560b5acc436d42c8bb680a9d93ee600915d486b2870317549/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a656e646672616d65776f726b2f5a656e64586d6c2e7376673f6272616e63683d6d6173746572)](https://secure.travis-ci.org/zendframework/ZendXml)[![Coverage Status](https://camo.githubusercontent.com/095a74f0950f77dbcc1e82e94bb54bc25cda21efae7897c6bfcfb1cfa646e087/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a656e646672616d65776f726b2f5a656e64586d6c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zendframework/ZendXml?branch=master)

An utility component for XML usage and best practices in PHP

Installation
------------

[](#installation)

You can install using:

```
curl -s https://getcomposer.org/installer | php
php composer.phar install

```

Notice that this library doesn't have any external dependencies, the usage of composer is for autoloading and standard purpose.

ZendXml\\Security
-----------------

[](#zendxmlsecurity)

This is a security component to prevent [XML eXternal Entity](https://www.owasp.org/index.php/XML_External_Entity_%28XXE%29_Processing) (XXE) and [XML Entity Expansion](http://projects.webappsec.org/w/page/13247002/XML%20Entity%20Expansion) (XEE) attacks on XML documents.

The XXE attack is prevented disabling the load of external entities in the libxml library used by PHP, using the function [libxml\_disable\_entity\_loader](http://www.php.net/manual/en/function.libxml-disable-entity-loader.php).

The XEE attack is prevented looking inside the XML document for ENTITY usage. If the XML document uses ENTITY the library throw an Exception.

We have two static methods to scan and load XML document from a string (scan) and from a file (scanFile). You can decide to get a SimpleXMLElement or DOMDocument as result, using the following use cases:

```
use ZendXml\Security as XmlSecurity;

$xml =
