New PHP Simple Large XML Parser version

October 2nd, 2009 by Dragos Leave a reply »

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:

<?php

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:

<?php

   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)
New PHP Simple Large XML Parser version, 10.0 out of 10 based on 1 rating
Advertisement

Comments are closed.