Revision [1209]

Last edited on 2011-10-28 08:35:34 by FsseInfo
Deletions:
====PHP DOM PLUS====
PhpDomPlus
====PHP DOM Xpath====
PhpDomXpath


Revision [1206]

Edited on 2011-10-27 03:15:43 by FsseInfo
Additions:
====PHP DOM PLUS====
PhpDomPlus


Revision [1190]

Edited on 2011-10-14 07:39:05 by FsseInfo
Additions:
====PHP DOM Xpath====
PhpDomXpath


Revision [1183]

Edited on 2011-10-10 09:14:49 by FsseInfo
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}}
Deletions:
====PHP DOM====


Revision [770]

The oldest known version of this page was created on 2008-10-21 22:35:17 by FsseInfo
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki