#22295 [Opn->Csd]: Again MS XML DOM Error
| From: | phanto@php.net | Date: | Thu, 20 Feb 2003 11:34:35 +0000 |
| Subject: | #22295 [Opn->Csd]: Again MS XML DOM Error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-33663@lists.php.net to get a copy of this message | ||
ID: 22295
Updated by: phanto@php.net
Reported By: vodmal at newmail dot ru
-Status: Open
+Status: Closed
Bug Type: COM related
Operating System: Windows 2000
PHP Version: 4CVS-2003-02-19 (stable)
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-02-19 04:56:23] vodmal at newmail dot ru
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 this bug report at http://bugs.php.net/?id=22295&edit=1