#!/usr/bin/perl


sub x_1 {
  my ($inFile, $xslFile, $outFile) = @_;

  my $x = "java -cp lib/xalan.jar:lib/serializer.jar org.apache.xalan.xslt.Process -IN $inFile -XSL $xslFile -OUT $outFile";
  print "$x \n";
  print `$x`;

  die "Could not run XSL\n" if $?;

}

 @ documents = (
	"APE",    "APHP",             "APS",    "CRD",    "CTNN",   "DSC",
	"EDPN",   "EDR",    "EHCP",   "ENS",    "ETC",    "IC",     "LDHP",
	"LDS",    "MCHCGS", "MCHHBS", "MDS",    "NDS",     "NN",    "PPOC",
	"PPVS",   "PRPHCA", "TN",
	"XDSMSDischarge",
	"XDSMSReferral",
	"XPHRExtract",
	"XPHRUpdate",
 );
# APL, ETC
 foreach $d(@documents) {
  print "$d\n";
  x_1("PCC_SampleCDA_01.xml", "xsl-gen/$d" . "_gen.xsl", "cda-gen/$d" . "_generated.xml");
 }

#  x_1("PCC_SampleCDA_01.xml",
#	"xsl-gen/copy_all_sections.xsl", "all_sections.xml");
