diff --git a/.classpath b/.classpath
index 173e474b..838ce3f6 100644
--- a/.classpath
+++ b/.classpath
@@ -4,6 +4,6 @@
-
+
diff --git a/build.xml b/build.xml
index 1d8671a2..6186b5fd 100644
--- a/build.xml
+++ b/build.xml
@@ -299,7 +299,9 @@
-
+
+
+
@@ -541,7 +543,9 @@
Importing metadata from ${entities.dir}/import.xml
-
+
+
+
@@ -581,7 +585,9 @@
-
+
+
+
diff --git a/build/Xalan.pm b/build/Xalan.pm
new file mode 100755
index 00000000..4c2ec208
--- /dev/null
+++ b/build/Xalan.pm
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+#
+# Simplified access to the Xalan XSLT processor.
+#
+
+#
+# xalanCall
+#
+# Provides the stem of a "system" call string to access Xalan with the
+# required extensions.
+#
+sub xalanCall
+{
+ my $xalanRoot = "../tools/xalan";
+
+ my $res = "java";
+
+ # Endorsed Xalan and Xerces
+ $res .= " -Djava.endorsed.dirs=$xalanRoot/endorsed";
+
+ # Classpath
+ my $classpath = '../bin';
+ while (glob "$xalanRoot/lib/*") {
+ $classpath .= ':' unless $classpath eq '';
+ $classpath .= $_;
+ }
+
+ $res .= " -cp $classpath";
+
+ # Class to invoke
+ $res .= " org.apache.xalan.xslt.Process";
+ $res;
+}
+
+#print ">>>" . xalanCall . "<<<\n";
+
+1;
diff --git a/build/addresses.pl b/build/addresses.pl
index 40e4f280..f650c6e0 100755
--- a/build/addresses.pl
+++ b/build/addresses.pl
@@ -1,5 +1,7 @@
#!/usr/bin/perl
+use Xalan;
+
#
# Load list addresses.
#
@@ -27,7 +29,7 @@
#
# UK addresses
#
-open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata-master.xml -XSL extract_addresses.xsl|") || die "could not open input file";
+open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-master.xml -XSL extract_addresses.xsl|") || die "could not open input file";
while () {
if (/(mailto:)?(.*)<\/EmailAddress>/) {
$metadata{$2} = 1;
diff --git a/build/check_entity.pl b/build/check_entity.pl
index 46456029..f891783c 100755
--- a/build/check_entity.pl
+++ b/build/check_entity.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
+use Xalan;
use File::Temp qw(tempfile);
use Date::Parse;
use Digest::SHA1 qw(sha1 sha1_hex sha1_base64);
@@ -29,7 +30,7 @@
unlink($temp) if -e $temp;
# extract embedded certificates
- open(EXTRACT, "java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN $fn -OUT $temp -XSL extract_embedded.xsl|")
+ open(EXTRACT, xalanCall . " -IN $fn -OUT $temp -XSL extract_embedded.xsl|")
|| die "could not open certificate extract process";
while () {
print $_;
diff --git a/build/count_scopes.pl b/build/count_scopes.pl
index f3c779fd..c20240c1 100755
--- a/build/count_scopes.pl
+++ b/build/count_scopes.pl
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w
-open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_scopes.xsl|") || die "could not open input file";
+use Xalan;
+
+open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_scopes.xsl|") || die "could not open input file";
while () {
# print $_;
chop;
diff --git a/build/extract_locs.pl b/build/extract_locs.pl
index ca183303..338a291c 100755
--- a/build/extract_locs.pl
+++ b/build/extract_locs.pl
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w
-open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_locs.xsl|") || die "could not open input file";
+use Xalan;
+
+open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_locs.xsl|") || die "could not open input file";
while () {
chop;
if (/^https:\/\/([^\/:]+(:\d+)?)(\/|$)/) {
diff --git a/build/import.pl b/build/import.pl
index e592b3ba..1a9a6e36 100755
--- a/build/import.pl
+++ b/build/import.pl
@@ -1,5 +1,7 @@
#!/usr/bin/perl -w
+use Xalan;
+
#
# Import an entity metadata fragment file.
#
@@ -10,4 +12,4 @@
# in entities/imported.xml.
#
-system("java -cp ../bin:../lib/joda-time-1.6.jar -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../entities/import.xml -OUT ../entities/imported.xml -XSL import.xsl");
+system(xalanCall . " -IN ../entities/import.xml -OUT ../entities/imported.xml -XSL import.xsl");
diff --git a/build/probe_certs.pl b/build/probe_certs.pl
index 877a5988..c4808a1f 100755
--- a/build/probe_certs.pl
+++ b/build/probe_certs.pl
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w
-open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata.xml -XSL extract_cert_locs.xsl|") || die "could not open input file";
+use Xalan;
+
+open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_cert_locs.xsl|") || die "could not open input file";
while () {
if (/^http:/) {
print "skipping http location: $_";
diff --git a/build/probe_nocerts.pl b/build/probe_nocerts.pl
index b7c783c2..f354676c 100755
--- a/build/probe_nocerts.pl
+++ b/build/probe_nocerts.pl
@@ -1,8 +1,10 @@
#!/usr/bin/perl -w
+use Xalan;
+
$known_bad{'census.data-archive.ac.uk:8080'} = 1; # it is really http, not https
-open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata.xml -XSL extract_nocert_locs.xsl|") || die "could not open input file";
+open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_nocert_locs.xsl|") || die "could not open input file";
while () {
chop;
if (/^http:/) {
diff --git a/tools/xalan/lib/joda-time-1.6.jar b/tools/xalan/lib/joda-time-1.6.jar
new file mode 100644
index 00000000..68068a4b
Binary files /dev/null and b/tools/xalan/lib/joda-time-1.6.jar differ