Archive for October, 2009

Simple XML Parser Namespace support

October 27th, 2009

I have added support for namespaces to the parser.
What this means, you are now able to register a namspace in order to be able to parse the XML.

Also the usage of this class changed.


$xml = ""; // parse an Atom feed

// create a new object
$parser = new SimpleLargeXMLParser();
// load the XML

// register the namespace
$parser->registerNamespace("atom", "");
// this will get an array of entries
$array = $parser->parseXML("//atom:feed/atom:entry");


As always, you can download the new version from here.

VN:F [1.9.22_1171]
Rating: 8.5/10 (14 votes cast)

New PHP Simple Large XML Parser version

October 2nd, 2009

I have added support for node attributes to the PHP Simple Large XML Parser class.

Now it’s possible to retrieve the structure of the XML document with the attributes of the nodes. If you choose to get the nodes also the structure of the result array will be different from the non-attribute array.

The new structure will be like this:


array('value'=> 'another node / value' ,
     'attributes'=>array('attribute name'=>'attribute value',
                    'another attribute'=>'some value',
                    'yet another attribute'=>'other value'


In order to get the array with attributes you need to pass the 3rd parameter as true:


   SimpleLargeXMLParser::parseXML($xml, "//myFirstNode", true);


You can download the new version from here.

Please [p2p type=”id” value=”180″ text=”read this post”] for more information about the functionality of the class:

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)