I encountered an issue using MSXML from Win32::OLE.

MSDN - MSXML - createProcessor Method
http://msdn.microsoft.com/en-us/library/ms753809%28VS.85%29.aspx

There's a JScript example on that page, which works.

I translated it to Perl (see script below), and I'm getting the
following error message:

  perl createProcessor.pl
  Win32::OLE(0.1709) error 0x80020003: "Mitglied nicht gefunden"
    in PROPERTYPUTREF "input" at createProcessor.pl line 26

"Mitglied nicht gefunden" translates to "Member not found".

Seen with ActivePerl 5.12.1:

  Binary build 1201 [292674] provided by ActiveState
  Built May 14 2010 00:34:27

          \,,,/
          (o o)
------oOOo-(_)-oOOo------ createProcessor.pl
use strict;
use warnings;
use Win32::OLE;
Win32::OLE->Option(Warn => 3);
my $xslt   = Win32::OLE->new("Msxml2.XSLTemplate.3.0");
my $xslDoc = Win32::OLE->new("Msxml2.FreeThreadedDOMDocument.3.0");
my $xslProc;
my $myErr;
$xslDoc->{async} = 0;
$xslDoc->load("createProcessor.xsl");
if ($xslDoc->parseError->errorCode != 0) {
  $myErr = $xslDoc->parseError;
  printf("You have error %s\n" + $myErr->reason);
}
else {
  $xslt->{stylesheet} = $xslDoc;
  my $xmlDoc = Win32::OLE->new("Msxml2.DOMDocument.3.0");
  $xmlDoc->{async} = 0;
  $xmlDoc->load("books.xml");
  if ($xmlDoc->parseError->errorCode != 0) {
    $myErr = $xmlDoc->parseError;
    printf("You have error %s\n" + $myErr->reason);
  }
  else {
    $xslProc = $xslt->createProcessor();
    $xslProc->{input} = $xmlDoc;
    $xslProc->addParameter("param1", "Hello");
    $xslProc->transform();
    print( $xslProc->output );
  }
}
__END__

The stylesheet createProcessor.xsl is the one given on the MSDN page.
The input document books.xml is just <books/>.

What am I doing wrong?

If it works in JScript, why does it not work in Perl? Do individual
methods and properties have to be registered somewhere in the Perl COM
bindings, or are they simply passed on as is?

What could I do to track down the cause of the error?

Thanks!
-- 
Michael Ludwig
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to