#23741 [Opn]: Problems using msxml via COM interface
| From: | jbelant at wpsenergy dot com | Date: | Thu, 22 May 2003 16:02:29 +0000 |
| Subject: | #23741 [Opn]: Problems using msxml via COM interface | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40197@lists.php.net to get a copy of this message | ||
ID: 23741
User updated by: jbelant at wpsenergy dot com
Reported By: jbelant at wpsenergy dot com
Status: Open
Bug Type: COM related
Operating System: Windows 2000
PHP Version: 4.3.2RC3
New Comment:
I just tried PHP 4.3.2RC4, and see the same problem
Previous Comments:
------------------------------------------------------------------------
[2003-05-21 11:26:27] jbelant at wpsenergy dot com
Hello
I am running Windows 2000 SP3, Apache 2.0.45, and PHP 4.3.2RC3. When I
try to use the getAttribute method of MSXML, I get the following error
message:
Warning: (null)(): Invoke() failed: Exception occurred. Source:
Unavailable Description: Unavailable in C:\Apache2\htdocs\get_xml.php
on line 198
Line 198 is where the getAttribute is called. However, this code works
perfectly with PHP4.3.2RC1.
Following is a snippet of the php code:
---------start code----------
#create a new ModbusTCP object
$MBObj = new ModbusTcp;
#define the path to the web server files
$serverpath = "c:\\Apache2\\htdocs\\";
#define the path to point data
$XMLPath = "ModbusTCP/Points/Point";
#get the file name
$xsltfilename = $filename;
if ($xmltrue)
{
$xmlfile = $filename;
}
else
{
#load the xslt file into an array
$xsltfile = file($serverpath.$xsltfilename);
#get the xml file name
$xmlfile = $xsltfile[0];
#get the xsl file name
$xslfile = $xsltfile[1];
$xsl = new COM("Msxml2.DOMDocument");
$xsl->async = false;
$xsl->load($serverpath.$xslfile);
}
$xml = new COM("Msxml2.DOMDocument");
$xml->async = false;
$xml->load($serverpath.$xmlfile);
$nodes = $xml->getElementsByTagName("ModbusTCP/IP");
$node = $nodes->item(0);
$ip = $node->text;
$nodes = $xml->getElementsByTagName("ModbusTCP/UnitID");
$node = $nodes->item(0);
$id = $node->text;
$nodes = $xml->getElementsByTagName("ModbusTCP/NumRegisters");
$node = $nodes->item(0);
$NumReg = $node->text;
$nodes = $xml->getElementsByTagName("ModbusTCP/StartAddr");
$node = $nodes->item(0);
$Offset = $node->getAttribute("Offset");
-------end code-----------
Any ideas on what could be causing this?
Jim
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23741&edit=1