Recommend this page to a friend! |
Download .zip |
Info | View files (8) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2004-02-27 (12 years ago) | 57% | Total: 5,468 This week: 1 | All time: 426 This week: 1,047 |
Version | License | Categories | ||||
x2a 1.0 | GNU Lesser Genera... | XML, Data types |
Description | Author | |||||||||||||
The class is meant to parse an XML file and load it into an array. |
|
CXml2Array version 1.1 27/02/2004 Description: ---------------------- The class is meant to parse an XML file and load it into an array. The module uses the DOMXML functions to parse the tag's values, the tag's attribute, the external entity and CDATA section. Also the class provides some functions to retrieve all or part of the array made from the XML file. Installation: ---------------------- PHP => 4.3.0 - I've test the class using PHP 4.3.0 and PHP 4.3.1. I think the class should work with PHP 4.2.x. The DOMXML extension enabled (see PHP manual how to enable it) Usage: ---------------------- // Here the code to run the class require 'CXml2Array.php'; $InName='test.xml'; if(!$TplDom = domxml_open_file(realpath($InName))) trigger_error('Error parsing the file ',E_USER_ERROR); $root = $TplDom->document_element(); $x=new CXml2Array($root); $ArrayXml=x->GetArray(); // if you want see the array contents, use $x->ArrayDump(); See test1.php to get more complete information about the usage visit my site http://www.andrioli.com/en/php.html ChangeLog: ---------------------- 1.1 - 27/2/2004 * Changed, now the child's tag are retrieved in the same order they are in the XML file * Changed, the text inside the tag are 'right-trimmed' in order to maintain the left spaces * New, new functions: GetText, GetTagName, EachChild, EachChildArray 1.0 - 15/12/2003 * First public release That's all. I hope it be useful. Darvin (darvin at andrioli dot com) |
Files |
File | Role | Description |
---|---|---|
CXml2Array.php | Class | Class source |
lgpl.txt | Lic. | License |
menu.ent | Data | Test data |
menu.left.ent | Data | test data |
menu.oriz.php.ent | Data | Test data |
readme.txt | Doc. | Class documentation |
test.xml | Data | Test data |
test1.php | Example | Test script |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.