I want to use perl to transform xml to html via an xsl. I found this little script which promises to do so. I downloaded both modules but they complain for the latest libxml2 version from I went there, i obtained the files and now im getting into something too big. I need to be able to port this easily, one or two modules is fine, but i cannot port an entire library. Does any one know a simpiler way to get the transform to work without downloading muliple files?
Code:
use XML::LibXSLT;
use XML::LibXML;
# the arguments for this command are stylesheet and source files
my( $style_file, @source_files ) = @ARGV;
# initialize the parser and XSLT processor
my $parser = XML::LibXML->new( );
my $xslt = XML::LibXSLT->new( );
my $stylesheet = $xslt->parse_stylesheet_file( $style_file );
# for each source file: parse, transform, print out result
foreach my $file ( @source_files ) {
my $source_doc = $parser->parse_file( $source_file );
my $result = $stylesheet->transform( $source_doc );
print $stylesheet->output_string( $result );
}