<?
require('Xml.php');
// declaring a new XML object
$xml=new Xml('test.xml');
// getting all nodes which name is 'book'
$nodes=$xml->getElementsByTagName('book');
// getting all nodes having property name='author'
$nodes=$xml->getElementsByPropertyValue('name','author');
// printing out the nodes-list object
$nodes->_print();
// retrieving the first item from the list
$nodes->item(0);
// concatenating node requests
// here we get the 2nd child of 1st child of first node of the list
$nodes->item(0)->item(0)->item(1);
?>
|