PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Dec 07, 2019 1:08 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Mon Dec 12, 2011 12:17 pm 
Offline
Forum Commoner

Joined: Sat May 19, 2007 4:10 am
Posts: 50
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

Syntax: [ Download ] [ Hide ]
<?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();


Outputs

Syntax: [ Download ] [ Hide ]
<?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>


Regards,
Sandeep.


Top
 Profile  
 
PostPosted: Fri Dec 16, 2011 11:11 pm 
Offline
Forum Commoner

Joined: Sat May 19, 2007 4:10 am
Posts: 50
Hi,

I have added some self guided tutorial like functionality to the demo at http://crxml.pagodabox.com/demo.php so that you can check the capabilities of the class by trying out examples at http://crxml.pagodabox.com...

Regards,
Sandeep.


Top
 Profile  
 
PostPosted: Mon Dec 26, 2011 5:00 am 
Offline
Forum Commoner

Joined: Sat May 19, 2007 4:10 am
Posts: 50
hi..

I have added couple of functionality to the class like the direct node replacement and adding a child xml node to another xml document on the fly using factory method.

regards,
Sandeep


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group