Technick.com S.r.l. - Open Source Software

XMLConfigReader

XMLConfigReader is an open-source PHP5 class to read configuration data directly from an XML file.

XMLConfigReader reads resource text data directly from a XML file and store it on a bidimensional array. The first dimension keys are taken from the value of the id attribute of the <item> elements. The second dimension array keys are taken from the names of the sub-items tags. The values are taken from the content of sub-items tags.
Once the XML data importing process is completed, array elements could be normally accessed using keys and subkeys.

Example

// 1. include the XMLConfigReader class file in your project
require_once('XMLConfigReader.php');

// 2. istantiate new XMLConfigReader object reading the sample.xml file
$xmldata = new XMLConfigReader("sample.xml");

// 3. get resource array
$resource = $xmldata->getResource();

// 4. display some values
echo $resource['2']['name'];
echo $resource['2']['description'];

// 5. display the key for the specified element
echo $xmldata->getKey("description", "third element");

Documentation and examples are included on the distribution.

Download XMLConfigReader from SourceForge

Get XMLConfigReader - PHP version at SourceForge.net. Fast, secure and Free Open Source software downloadsSupport This Project
name: password: [register]

| TXT | TXT+
The contents of this site are copyright © Tecnick.com s.r.l. All Rights Reserved.
Tecnick.com s.r.l. - Sede Legale: Via Della Pace, 11 – 09044 – Quartucciu (CA) – ITALY - Capitale Sociale € 10.000,00 i.v. - P. IVA e C.F.: 02574420929 - C.C.I.A.A.: CA-2000-19195 - R.E.A.: 208980

Powered by Tecnick.com AIOCP (All In One Control Panel) Tecnick.com is SUN Associate Partner Tecnick.com is Java.net Silver Partner

Valid XHTML 1.0! Valid CSS1! Level Double-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0 GetJava Download Button





Bookmark and Share


English Italian