PHP Classes

amba XML document: Extend the DOM XML classes

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 264 All time: 7,774 This week: 455Up
Version License PHP version Categories
amba-xml-document 3.2BSD License5.3XML, PHP 5


This package extends the DOM XML classes to provide additional functionality.

The DOM Document extension class can return the document root element, add a new node to the end of the document, select nodes that match a XPath expression, call a function for a list of elements and transform a document using XSL.

The DOM element extension class can get XML for the owner document, get the node XPath, get child nodes, select child nodes that match a XPath expression, get the parent and sibling nodes, get and set attributes by name, copy attributes, add child nodes and character data, import and export nodes to and from another document, set and get the inner XML of a node, call a function for nodes that map a XPath expression, etc..

Standard DOMDocument has rich functionality, but it is not handy enough. XMLDocument is extension of standard PHP DOMDocument and DOMElement.

This project contains two classes for easy create, navigate and process XML documents.

Main features is:

* SelectSingleNode and SelectNodes - node related functions works like same functions in C#.
* Inner XML getting/setting - easy and in one line.
* Chain style to create new node sets.
* Functions for frequently used actions: copy attributes, delete all childs etc.

Usage sample:

$doc = new XMLDocument("<Users/>");
->setAttribute('Active', 'true')
->addNodeWithCData('Name', 'John')
echo $doc->saveXML();


<User Active="true">

See Samples for more details.

Picture of Alexey V Ryazhskikh
Name: Alexey V Ryazhskikh <contact>
Classes: 1 package by
Country: Russian Federation Russian Federation
Age: 39
All time rank: 3932112 in Russian Federation Russian Federation
Week rank: 301 Up13 in Russian Federation Russian Federation Up

  Files folder image Files  
File Role Description
Plain text file XMLDocument.php Class Extends DOMDocument
Accessible without login Plain text file XMLDocumentTest.php Test Tests for XMLDocument and XMLElement
Plain text file XMLElement.php Class Extends DOMElement

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,774
This week:455Up