PHP Classes

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    
Ratings Unique User Downloads Download Rankings
StarStarStar 57%Total: 10,429 This week: 1All time: 123 This week: 560Down
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
Age: 43
All time rank: 791 in Czech Republic Czech Republic
Week rank: 106 Down2 in Czech Republic Czech Republic Down

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,429
This week:1
All time:123
This week:560Down
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:1670