#### System Products Book #### #!/bin/perl # import required modules use XML::XSLT; use XML::Hash; use Data::Dumper; # define local variables my $xslfile = "test.xsl"; my $xmlfile = "test.xml"; # create an instance of XSL::XSLT processor my $xslt = XML::XSLT->new ($xslfile, warnings => 0, debug => 0); # transforms the XML file using the XSL style sheet my $results = $xslt->transform ($xmlfile); print $results; # Convertion from a XML::DOM::Document into a HASH my $xml_converter = XML::Hash->new(); my $xml_hash = $xml_converter->fromDOMtoHash($results); # send to output print Dumper($xml_hash); # free up some memory $xslt->dispose();