View Single Post
Old 01-18-2008, 08:37 PM   #5 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

i'll just assume that you dont know how to do it, PHP DOM to the rescue....again.

ach! if i have to code one more php DOM script today i think i may go completely mad ,actually thats a lie, as its already happend EHHHEHEHHHHAHAHAHAHAAH

*clears throat*

anyway back to php for a moment if we may (how ever funny insanity may be)

PHP Code:
$pDomDoc = new DomDocument('1.0');
//create root node <imageCacheResult />
$root $pDomDoc->appendChild($pDomDoc->createElement('imageCacheResult'));

//create <url /> node, then add a text node to it
$url $root->appendChild($pDomDoc->createElement('url'));
$url->appendChild($pDomDoc->createTextNode('value of url'));

//create <thumbnail />, then append a text node to it
$thumb $root->appendChild($pDomDoc->createElement('thumbnail');
$thumb->appendChild($pDomDoc->createTextNode('value of thumbnail'));

//save the xml
return $pDomDoc->saveXML(); 
that should work, hopefully and return this xml in a string:
xml Code:
<?xml version="1.0" ?>
<imageCacheResult>
    <url>value of url</url>
    <thumbnail>value of thumbnail</thumbnail>   
</imageCacheResult>
if you need to specifiy a charset, just pass it into the second param in the DomDocument construct i.e.:
PHP Code:
$pDomDoc = new DomDocument('1.0''UTF-8'); 
hope that helps
Im off to continue my insanity now gooooooooooooooobyyyyyyyyyyyeeeeee
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)

Last edited by sketchMedia : 01-18-2008 at 10:25 PM. Reason: fingers dont want to listen to my brain
sketchMedia is offline  
Reply With Quote