Re: CRXML,A Replacement for SimpleXML
Posted: Mon Dec 12, 2011 11:17 am
Hi,
I have recently moved the class and demo to pagodabox.com which provides better hosting. So the demo and downloads should work faster.
These are the links
Documentation at http://crxml.pagodabox.com
Demo at http://crxml.pagodabox.com/demo.php
Class source ,Documentation and demo http://crxml.pagodabox.com/crXml.tar
I recently had great success with this class with the work I am currently working on. This involved recieving an namespaced xml string, Change some attributes of some nodes and resend it to another server. I could accomplish this with < 10 lines of code.
Below Sample illustrates the operation
Outputs
Regards,
Sandeep.
I have recently moved the class and demo to pagodabox.com which provides better hosting. So the demo and downloads should work faster.
These are the links
Documentation at http://crxml.pagodabox.com
Demo at http://crxml.pagodabox.com/demo.php
Class source ,Documentation and demo http://crxml.pagodabox.com/crXml.tar
I recently had great success with this class with the work I am currently working on. This involved recieving an namespaced xml string, Change some attributes of some nodes and resend it to another server. I could accomplish this with < 10 lines of code.
Below Sample illustrates the operation
Code: Select all
<?php
include 'crXml.php';
$x = new crXml();
$xmlStr = <<<EOB
<?xml version="1.0" encoding="UTF-8"?>
<records>
<person age="15">
<name>
alex
</name>
</person>
<person age="28">
<name>
sandeep
</name>
</person>
</records>
EOB;
$x->loadXML($xmlStr);
$x->records->person[1]['age'] = '30'; //sets second persons attribute to 30
$x->records->person[1]->name = 'albert'; // sets child node 'name' of second person to 'albert'
$x->records->person[2] = $x->records->person[1]; // create a third `person` node and assign it the value of second 'person' node.
echo $x->xml();Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<records>
<person age="15">
<name>alex</name>
</person>
<person age="30">
<name>albert</name>
</person>
<person>
<name>albert</name>
</person>
</records> Sandeep.