xt.pl

  1. $XSL_ENGINE = 'c:\q\jre\bin\java -cp c:\q\xt\xt.jar;c:\q\xp\xp.jar com.jclark.xsl.sax.Driver';
  2. print "\n";
  3. use Cwd;
  4. use File::Path;
  5. use File::Basename;
  6. use Zvon::Filesystem;
  7. #######################
  8. $xmlFile = $ARGV[0];
  9. $xslFile = $ARGV[1];
  10. $interactive = $ARGV[2]; #default YES; switch NO
  11. if (!(-e $xmlFile)) {$xmlFile = "$xmlFile\.xml";};
  12. if (!(-e $xmlFile)) {$xmlFile = '';};
  13. if (!(-e $xslFile)) {$xslFile = "$xslFile\.xsl";};
  14. if (!(-e $xslFile)) {$xslFile = '';};
  15. if ($interactive ne 'NO')
  16. {
  17. print STDOUT "\n\nProgram XT started.\n";
  18. print STDOUT "XML File: [$xmlFile]: ";
  19. $tmp = <STDIN>;
  20. chomp($tmp);
  21. if($tmp ne ""){$xmlFile=$tmp;};
  22. if (!(-f $xmlFile)) {$xmlFile = Filesystem::filelist();}
  23. print STDOUT "XSL File [$xslFile]: ";
  24. $tmp = <STDIN>;
  25. chomp($tmp);
  26. if($tmp ne ""){$xslFile=$tmp;};
  27. if (!(-f $xslFile)) {$xslFile = Filesystem::filelist();}
  28. }
  29. $htmlFile = $xmlFile;
  30. $htmlFile =~ s/\..*/\.html/;
  31. system "$XSL_ENGINE $xmlFile $xslFile $htmlFile";