PHP MergeXML class
The class allows to merge the XML sources (files, strings, objects) into single PHP XML object. The merging is performed recursively on the node level adding new elements and replacing existing ones. The nodes with the same path/name are replaced/added sequentially and the modification can be controlled by the options.
MergeXML could be useful in cases where it is necessary to gather XML data from multiple sources. For example, to join the configuration files of different subsystems depending on the system operation.
The following files are included:
- mergexml.php - the MergeXML class; requires PHP 5.2+;
- example.html - client-side to select the xml files and display result;
- example.php - server-side to receive & pass the xml data and return result;
- test1.xml, test2.xml - test data for the example;