Hi,
Is anybody familiar with how to use COM objects in PHP? I made a litle test code and everithing is seems to work fine, except when I trie to call function in COM object. Does anybody know how to do this?
Why I'm getting
"Warning: Invoke() failed: Type mismatch."
message when i try to call function in COM object???
What Am I doing wrong?
Simon
Here is the example code:
<?php
// Set the source and style sheet locations here
$root = "c:\inetpub\wwwroot\simple\";
$sourceFile = $root."simple.xml";
$styleFile = $root."simple.xsl";
// Load the XML
$source = new COM( "Microsoft.XMLDOM" ) or die( "Cant read Microsoft.XMLDOM" );
$source->async = false;
$source->load( $sourceFile );
// Load the XSL
$style = new COM( "Microsoft.XMLDOM" ) or die( "Cant read Microsoft.XMLDOM" );
$style->async = false;
$style->load( $styleFile );
// set up the resulting document
$result = new COM( "Microsoft.XMLDOM" ) or die( "Cant read Microsoft.XMLDOM" );
$result->async = false;
$result->validateOnParse = true;
// parse results into a result DOM Document
//com_invoke( $source, "transformNodeToObject", $style, $result );
$source->transformNodeToObject( $style, $result );
echo $result;
?>