From: vodmal at newmail dot ru
Operating system: Windows 2000
PHP version: 4CVS-2003-02-19 (stable)
PHP Bug Type: COM related
Bug description: Again MS XML DOM Error
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?
--
Edit bug report at http://bugs.php.net/?id=22295&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22295&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22295&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22295&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22295&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22295&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22295&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22295&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22295&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22295&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22295&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22295&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22295&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22295&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22295&r=gnused