Find file
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (56 sloc) 1.72 KB

Welldom, the XML toolbox for PHP Build Status

Welldom try to ease the use of DOM to manipulate XML documents with the following features :

  • Error management
  • Unique encoding for XML input/output
  • Simple methods to query and manipulate the DOM with Xpath
  • Batch on node list
  • Node rename & remove methods


  • PHP 5.3+
  • PHPUnit 5.6+


The library follow the PSR-0 naming convention. To load the library, use any compliant class loader or simply require the src/autoload.php file.

require __DIR__ . '/path/to/expdom/src/autoload.php';


Load an XML document:


use Welldom\Document;

$doc = new Document('UTF-8');

if (false === $doc->load('data.xml')) {
    $errors = $doc->getLastErrors();
    throw new Exception("XML Loading error\n" . implode("\n", $errors));

// ... enjoy your DOM document

Find a node values using XPath:

$values = array(
    'title' => $doc->getNodeValue('//book/title'),
    'lang' => $doc->getNodeValue('//book/title/@lang', 'en'),

Execute action on each node matching a given Xpath:



Run tests

Run PHPUnit test suite:



For the full copyright and license information, please view the LICENSE file that was distributed with this source code.