Subject: Calling Java Xalan inside Perl on Unix
To: None <XSL-List@lists.mulberrytech.com, netbsd-help@netbsd.org>
From: Gan Uesli Starling <alias@starling.us>
List: netbsd-help
Date: 04/17/2003 10:07:42
Howdy,

Anybody know how to call Xalan from a Perl script on
NetBSD Unix? I can't seem to get it right. I try like
so in my Perl script...

<snip>
($file_name) = @ARGV;

@xsl = ("java", "org.apache.xalan.xslt.Process -in 
$file_name.xml -xsl pdfmarks.xsl -out pdfmarks.txt");
system(@xsl);
</snip>

...but it does not work because I get this
nastygram with regard to Java class...

<snip>
baal: {16} ./gus_pdfmark.pl foo
Can't find class org.apache.xalan.xslt.Process -in foo.xml 
-xsl howto.xsl -out foo.html
baal: {17}
</snip>

...but if I simply do the same thing on command
line like so...

<snip>
java org.apache.xalan.xslt.Process -in foo.xml -xsl howto.xsl 
-out foo.html
</snip>

...then it works because I have my classpath set in ~/.cshrc on
my NetBSD Unix box. I can make it all work by doing in two stages
on command line, Java Xalan then Perl. But I would rather do 
in just one
stage, call the Perl and have it call Java. Anybody know now to do
that?

Thanks,

Gan
-- 

  Mistera Sturno - Rarest Extinct Bird

  <(+)__       Gan Uesli Starling
   ((__/)=-    Kalamazoo, MI, USA
    `||`
     ++        http://starling.us