PHP DOM vs DOM/XML
Posted: Sat Jul 22, 2006 4:06 am
My homepages php is 4.4.2. It doesnt have plain DOM, but a DOM/XML.
It doesnt say in php.net if the plain DOM is php4 or php5 feature. Can i get plain DOM in php 4.4.2?
Is it worth starting to do something with DOM/XML?
Whats the difference between these?
Doesnt this mean it doesnt understan a <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> ive written?
But how come it knows domdocument, but not loadXML ?
It doesnt say in php.net if the plain DOM is php4 or php5 feature. Can i get plain DOM in php 4.4.2?
Is it worth starting to do something with DOM/XML?
Whats the difference between these?
Doesnt this mean it doesnt understan a <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> ive written?
Code: Select all
$xml_string = "<?xml version='1.0'?>
<sentence>What a wonderful profusion of colors and smells in the market -
<vegetable color='green'>cabbages</vegetable>,
<vegetable color='red'>tomatoes</vegetable>,
<fruit color='green'>apples</fruit>,
<vegetable color='purple'>aubergines</vegetable>,
<fruit color='yellow'>bananas</fruit>
</sentence>";
$doc = new DOMDocument();
$doc->loadXML($xml_string);
echo $doc->saveXML();