mr_burns wrote:
It is managing to output the 'id' attribute but the node value isnt
appearing. Can anybody tell me how to sort it? Cheers
Switched over to PHP 5 already? Then try the following:
<?php
$xml_document = new DomDocument;
$xml_document->load('xml/countries.xml');
if ($xml_document) {
$items = $xml_document->getElementsByTagName('country');
for ($i = 0; $i < $items->length; $i++) {
$item = $items->item($i);
print $item->getAttribute('id') . " = " . $item->nodeValue . "<br>";
}
}
?>
JW