diff translate.pl @ 1:d1400de5832b

improved xsl
author cin
date Fri, 21 Aug 2015 20:07:52 +0300
parents 8cae44c166d3
children d2efec56373f
line wrap: on
line diff
--- a/translate.pl	Thu Aug 20 20:54:19 2015 +0300
+++ b/translate.pl	Fri Aug 21 20:07:52 2015 +0300
@@ -1,11 +1,25 @@
 #!/usr/bin/perl -w
 
-xalan( -IN => "bug-list2.xml", -XSL => "bug-list.xsl" );
+our @ClassPath = qw(
+  /usr/share/java/xalan-j2-serializer.jar
+  /usr/share/java/xalan-j2.jar
+  /usr/share/java/xerces-j2.jar
+  /usr/share/java/xml-commons-resolver.jar
+  .
+);
+
+xalan(
+	-IN          => "bug-list1.xml",
+	-XSL         => "bug-list.xsl",
+	-URIRESOLVER => "org.apache.xml.resolver.tools.CatalogResolver",
+	-ENTITYRESOLVER => "org.apache.xml.resolver.tools.CatalogResolver"
+);
 
 sub xalan {
 	my %params = @_;
-	
-	return system java => -cp => "/usr/share/java/xalan-j2-serializer.jar:/usr/share/java/xalan-j2.jar", "org.apache.xalan.xslt.Process", %params;
+	return system 'java',
+	  -cp => join( ':', @ClassPath ),
+	  "org.apache.xalan.xslt.Process", %params;
 }
 
 __END__
@@ -36,4 +50,4 @@
 
 =back
 
-=cut
\ No newline at end of file
+=cut