http://uk3.php.net/manual/en/book.dom.php
http://uk3.php.net/manual/en/class.domdocument.php
http://uk3.php.net/manual/en/class.domelement.php
http://framework.zend.com/manual/en/zend.http.html
http://framework.zend.com/apidoc/1.11/
http://uk3.php.net/manual/en/class.domdocument.php
http://uk3.php.net/manual/en/class.domelement.php
http://framework.zend.com/manual/en/zend.http.html
http://framework.zend.com/apidoc/1.11/
PHP DOM
On Centos 5 the PHP DOM extension is included in the PHP XML package !# yum install php-xml # service httpd restart
Being able to use PHP DOM to read/write and modify XML files can be useful when accessing REST web services.
DOM Document
$doc = new DOMDocument(); $doc->loadXML($xml); $doc->formatOutput=true;
DOM read value
$nodes = $doc->getElementsByTagName('books');
foreach($nodes as $n) {
echo $n->nodeName.$n->nodeValue;
}DOM modify value
$n->nodeValue=$newvalue;
DOM read attribute
$a = $n->attributes->getNamedItem('id');
$a = $n->attributes->getNamedItem('uid');DOM modify attribute
$oodes = $n->getElementsByTagName('book');
foreach($oodes as $o) {
$o->setAttribute("id", 2);
$o->setAttribute("uid", 34);
}DOM Save XML
$doc->saveXML()
REFERRERS
PhpXml