Last version: https://gist.github.com/1053576
sub TransformWithArgs {my ( $xsltFile , $xmlFile ,128); ">$argsHash ) = @_ ;
my $template = Win32:: OLE -> new ( 'MSXML2.XSLTemplate.4.0' )
my $xsltDoc = 'MSXML2.FreeThreadedDOMDocument.4.0' )
$xsltDoc -> { async } = "false" ;$xsltDoc -> { resolveExternals } = "false" ;$xsltDoc -> load ( $xsltFile );
$template -> { stylesheet } = $xsltDoc ;
my $xsltProc = $template -> createProcessor ();
my $xmlDoc = "Msxml2.DOMDocument.4.0" );$xmlDoc -> load ( $xmlFile );
# Note: ? The code can not work here: $xsltProc->{input} = $docXhtml;$xsltProc -> LetProperty ( 'input' ,128); ">$xmlDoc );
# Add parametes of XSLTforeach my $key ( keys %$argsHash ) {}
$xsltProc -> transform () or "Faied to transform.\n" ;my $result = $xsltProc -> { output };
$result ;}