}
my $optsname = "saxon";
-$optsname .= $saxonsa if defined($saxonsa);
$optsname .= "-$version";
+$optsname .= "a" if defined($saxonsa);
# Inelegantly, these are used as globals by several functions
my %seenopts = ();
# Figure out the class path separator before we go any further
my $cpseparator = $doc->getAttribute('classpath-separator');
# Default to ';' if it appears in $CLASSPATH, otherwise ':'
-$cpseparator = ($ENV{'CLASSPATH'} =~ /;/ ? ";" : ":")
+my $CLASSPATH = $ENV{'CLASSPATH'} || "";
+$cpseparator = ($CLASSPATH =~ /\;/ ? ";" : ":")
if !defined($cpseparator) or $cpseparator eq '';
foreach my $name (@opts, $optsname) {
$java = "java" if $java eq '';
-foreach my $path (reverse split(/$cpseparator/, $ENV{'CLASSPATH'})) {
+foreach my $path (reverse split(/$cpseparator/, $CLASSPATH)) {
unshift(@classpath, $path);
}
my $jprops = join(" ", @systemprops);
my $jcp = join($cpseparator, @classpath);
my $sopts = join(" ", @saxonopts);
-my $sparam = join(" ", @params);
+
+my $sparam = "";
+foreach my $param (@params) {
+ $sparam .= " " if $sparam ne '';
+ if ($param =~ /^(.+?)=(.+)$/) {
+ $sparam .= "$1=\"$2\"";
+ } else {
+ $sparam .= "$param";
+ }
+}
if ($cpseparator eq ';') {
# This must be cygwin or some windows flavor, let's try to make it work
}
}
-print "$java $jopts $classname $sopts $input $style $sparam\n" if $debug;
+print "$java $jopts -cp $jcp $jprops $classname $sopts $input $style $sparam\n" if $debug;
exec("$java $jopts -cp $jcp $jprops $classname $sopts $input $style $sparam");
# ============================================================