PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2005-07-31 (10 years ago) RSS 2.0 feedStarStarStar 58%Total: 10,299 All time: 118 This week: 1,048Down
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: 34
All time rank: 741 in Czech Republic Czech Republic
Week rank: 300 Down3 in Czech Republic Czech Republic Down

Details provided by the author  
/*
* 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%1Total:10,299All time:118
 This week:0This week:1,048Down
 User Ratings  
 
 All time
Utility:71%StarStarStarStar
Consistency:78%StarStarStarStar
Documentation:71%StarStarStarStar
Examples:82%StarStarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1030