|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-20 05:34 UTC] phanto@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 00:00:01 2025 UTC |
I'am locate error! :-) Look this source code: test.php =========== <? function a() { $xml = new COM("Msxml2.DOMDocument.4.0") or die("Can't instance Microsoft.XMLDOM"); $xml->async = false; $isXmlLoaded = $xml->load("D:\\Inetpub\\wwwroot 333\\mail\\test.xml"); if (!$isXmlLoaded) { die("Can't load XML"); } $items = $xml->selectNodes('//item'); //echo $items->length;\/ for ($i=0;$i<$items->length;$i++) { $item = &$items->item($i); getAttribute($item,"att"); echo "Ok!";flush(); getAttribute($item,"nonexistenceattributename"); echo "OK?";flush(); echo "<BR>"; } } function getAttribute(&$node,$name) { $attrib = $node->attributes->getNamedItem($name); $value = $attrib->nodeValue; return $value; } a(); ?> =========== test.xml =========== <?xml version="1.0"?> <content> <item att="test"/> </content> =========== Error appear when i'am try to get attribute by name for no existence attribute. I hope, that my bug-example help you locate bug. And one question: how i can query interface IXMLDOMElement in PHP for IXMLDOMNode element?