Deletions:
PhpDomPlus
====PHP DOM Xpath====
PhpDomXpath
Additions:
====PHP DOM PLUS====
PhpDomPlus
PhpDomPlus
Additions:
====PHP DOM Xpath====
PhpDomXpath
PhpDomXpath
Additions:
>>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/
>>====PHP DOM====
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
{{backlinks}}
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====
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
{{backlinks}}