#!/usr/bin/perl -w use diagnostics; use strict; use XML::XSLT; sub help { print "syntax: xml2any.pl \n"; exit(0); } if (scalar(@ARGV) < 2) { help(); }; my $xslfile = $ARGV[0]; my $xmlfile = $ARGV[1]; if (!-e $xslfile) { print "XSL file $xslfile does not exist!\n"; } if (!-e $xmlfile) { print "XML file $xmlfile does not exist~\n"; } my $parser = XML::XSLT->new ($xslfile, "FILE"); $parser->transform_document ($xmlfile, "FILE"); $parser->print_result; $parser->dispose ();