PHP Classes
elePHPant
Icontem

XML 2 Array: Parse an XML document into an array XPATH indexed

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2005-07-31 (11 years ago) RSS 2.0 feedStarStarStar 57%Total: 10,397 All time: 119 This week: 1,043Down
Version License Categories
xml2array 1.0.0GNU General Publi...XML, PHP 5, Data types
Description Author

This is a simple class can parse a XML document file and build an associative array from its elements.

The resulting array has as indices the XPATH location of the document data elements.

Picture of Michal Palma
Name: Michal Palma <contact>
Classes: 4 packages by
Country: Czech Republic Czech Republic

Details
/*
* Class to read XML file
* Class use SimpleXml - default PHP lib
* @package Xml2Array
* @date 2005-07-29
*/

This is very primitive class to read XML files.
It does not know to write XML data.
In construction of object You must specify complete filename with address.
Then You will use function __get() and in the parameter You will write XPATH of XML element from which You want content.
Throws standard PHP5 Exceptions with codes: -1 for error of opening file, 1 for error of reading XPATH from file
Thats all.

Some cases of use are defined in ___case_of_use.php.
  Files folder image Files  
File Role Description
Accessible without login Plain text file readmeFirst.txt Doc. description
Plain text file test.xml Data Auxiliary test data
Plain text file Xml2Array.class.php Class Xml2Array class
Accessible without login Plain text file ___case_of_use.php Example Cases of use

 Version Control Reuses Unique User Downloads Download Rankings  
 0%1
Total:10,397
This week:0
All time:119
This week:1,043Down
User Ratings User Comments (1)
 All time
Utility:70%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:68%StarStarStarStar
Examples:78%StarStarStarStar
Tests:-
Videos:-
Overall:57%StarStarStar
Rank:1429