From a08bf8c54aa51b9c76de583960ad954a7f26977c Mon Sep 17 00:00:00 2001
From: brutzman <brutzman@nps.edu>
Date: Sat, 2 Jul 2022 16:22:36 -0700
Subject: [PATCH] multiple updates

---
 build.xml | 61 +++++++++++++++++++++++++++++--------------------------
 1 file changed, 32 insertions(+), 29 deletions(-)

diff --git a/build.xml b/build.xml
index c102a56519..6f369db85a 100644
--- a/build.xml
+++ b/build.xml
@@ -104,11 +104,14 @@ POSSIBILITY OF SUCH DAMAGE.
     <!-- trouble report json-schema-validator-2.2.11.jar at https://github.com/java-json-tools/json-schema-validator/issues/287#issuecomment-544100447 -->
     <property name="json-schema-validator.jar"     value="lib/json-schema-validator-2.2.6-lib.jar"/>
 
-    <!-- https://www.saxonica.com/html/documentation11/about/index.html      -->
-    <!-- https://www.saxonica.com/html/documentation11/using-xsl/commandline -->
-    <!-- https://sourceforge.net/projects/saxon/files/Saxon-HE/11/Java       -->
-    <property name="saxon.dir"        location="../../../tools/jar" description="relative path from archive examples/Subdirectory"/>
-    <property name="saxon.jar"           value="saxon-he-11.2.jar"/><!-- previously saxon-he-10.6.jar saxon9he.jar -->
+    <!-- https://stackoverflow.com/questions/919692/how-to-execute-xslt-2-0-with-ant -->
+    <!-- https://sourceforge.net/projects/saxon/files/Saxon-HE jar download handled in X3DJSAIL build -->
+    <!-- https://sourceforge.net/projects/saxon/files/Saxon-HE/11/Java/ -->
+    <!-- https://www.saxonica.com/documentation10/#!about/gettingstarted/gettingstartedjava -->
+    <!-- SaxonHE 11 (java.lang.NoClassDefFoundError: org/xmlresolver/Resolver) https://saxonica.plan.io/boards/3/topics/8478?r=8480 -->
+    <property name="saxon.dir"        location="lib" description="relative path from stylesheets directory"/>
+    <property name="saxon.jar"           value="saxon-he-11.3.jar"/><!-- previously saxon-he-11.2.jar saxon-he-10.6.jar saxon9he.jar -->
+    <property name="xmlresolver.jar"     value="xmlresolver-4.2.0.jar"/><!-- required with saxon-he-11+.jar -->
 
     <!-- compiled stylesheets are no longer supported as of saxon 9.4 -->
 <!--<property name="saxononicaSA.dir" location="C:/java/saxonsa9-1-0-6j"/> not actively used -->
@@ -305,7 +308,7 @@ POSSIBILITY OF SUCH DAMAGE.
     <property name="X3dDtdsSchemas.dir"       location="../../../../specifications"/>
     <property name="resolver.dir"             location="${env.ANT_HOME}/lib"/>
     <property name="resolver.jar"             value="xml-resolver-1.2.jar"/>
-    <length property="resolver.jar.length" file="${resolver.dir}/${resolver.jar}"/>
+    <length property="resolver.jar.length" file="${saxon.dir}/${xmlresolver.jar}"/>
     <!-- original alternative to ant: https:///xerces.apache.org/mirrors.cgi XML Commons Resolver Version 1.2 - zip -->
 
 <!--
@@ -371,7 +374,7 @@ Key references:
 			<echo message="... -expand:'@{expand}' parameterPair1='@{parameterPair1}' parameterPair2='@{parameterPair2}' parameterPair3='@{parameterPair3}'"/>
             -->
 			<java classname="net.sf.saxon.Transform"
-				  classpath="${saxon.dir}/${saxon.jar};${resolver.dir}/${resolver.jar}"
+				  classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};${saxon.dir}/${xmlresolver.jar};"
 				  fork="${fork}"
 				  failonerror="false">
 				<!-- TODO
@@ -437,7 +440,7 @@ Key references:
         <attribute name="scene"/>
         <attribute name="title"/>
         <sequential>
-            <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+            <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
                 <!-- https://www.saxonica.com/documentation9.5/using-xsl/commandline.html -->
                     <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
                     <!-- <arg value="-t"/> saxon version and timing information -->
@@ -515,7 +518,7 @@ Key references:
 
     <target name="saxon.help" description="display command-line settings">
         <java classname="net.sf.saxon.Transform"
-              classpath="${saxon.dir}/${saxon.jar};${resolver.dir}/${resolver.jar}"
+              classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};${saxon.dir}/${xmlresolver.jar};"
               fork="${fork}"
               failonerror="false">
             <arg value="-?"/>
@@ -1380,7 +1383,7 @@ ignoreSetupDownloadErrors=true
         <echo message="               X3dDtdsSchemas.dir=${X3dDtdsSchemas.dir}"/>
         <echo message="        ignoreSetupDownloadErrors=${ignoreSetupDownloadErrors}"/>
         <echo message="   saxon path: ${saxon.dir}/${saxon.jar}"/>
-   <!-- TODO <echo message="resolver path: ${resolver.dir}/${resolver.jar} (${resolver.jar.length} bytes)"/> -->
+   <!-- TODO <echo message="resolver path: ${saxon.dir}/${xmlresolver.jar}; (${resolver.jar.length} bytes)"/> -->
 
         <!-- make library directories for supporting jar files -->
         <mkdir  dir="jenkins/lib"/>
@@ -1662,7 +1665,7 @@ ignoreSetupDownloadErrors=true
         <!-- java net.sf.saxon.Transform -s:source -o:output  -xsl:stylesheet -->
         <!-- $(SAXON) -t -s:HelloWorld.x3d -o:HelloWorld.html -xsl:../X3dToXhtml.xslt -->
         <!-- note reordering of parameters for source, output contrary to Saxon documentation! -->
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:HelloWorld.x3d"/>
@@ -1670,7 +1673,7 @@ ignoreSetupDownloadErrors=true
             <arg value="-xsl:${stylesheet.dir}/X3dToXhtml.xslt"/>
         </java>
         <echo message="Convert HelloWorld.x3d to HelloWorldX_ITE.html using X3dToX3dom.xslt stylesheet"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:HelloWorld.x3d"/>
@@ -1682,7 +1685,7 @@ ignoreSetupDownloadErrors=true
             <arg value="extension=html"/>
         </java>
         <echo message="Convert HelloWorld.x3d to HelloWorldX3dom.xhtml using X3dToX3dom.xslt stylesheet"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:HelloWorld.x3d"/>
@@ -1690,7 +1693,7 @@ ignoreSetupDownloadErrors=true
             <arg value="-xsl:${stylesheet.dir}/X3dToX3dom.xslt"/>
         </java>
         <echo message="Convert HelloWorld.x3d to HelloWorld.wrl using X3dToVrml97.xslt stylesheet"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/>
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:HelloWorld.x3d"/>
@@ -1698,7 +1701,7 @@ ignoreSetupDownloadErrors=true
             <arg value="-xsl:${stylesheet.dir}/X3dToVrml97.xslt"/>
         </java>
         <echo message="Convert HelloWorld.x3d to HelloWorld.x3dv using X3dToX3dvClassicVrmlEncoding.xslt stylesheet"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/>
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:HelloWorld.x3d"/>
@@ -1847,7 +1850,7 @@ ignoreSetupDownloadErrors=true
         <!-- java net.sf.saxon.Transform -s:source -o:output -xsl:stylesheet -->
         <!-- $(SAXON) -t -s:newScene.x3d -o:newScene.html -xsl:../X3dToXhtml.xslt -->
         <!-- note reordering of parameters for source, output contrary to Saxon documentation! -->
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:newScene.x3d"/>
@@ -1855,7 +1858,7 @@ ignoreSetupDownloadErrors=true
             <arg value="-xsl:${stylesheet.dir}/X3dToXhtml.xslt"/>
         </java>
         <echo message="Convert newScene.x3d to newSceneX_ITE.html using X3dToX3dom.xslt stylesheet in X_ITE mode"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:newScene.x3d"/>
@@ -1867,7 +1870,7 @@ ignoreSetupDownloadErrors=true
             <arg value="extension=html"/>
         </java>
         <echo message="Convert newScene.x3d to newSceneX3dom.xhtml using X3dToX3dom.xslt stylesheet in default mode"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:newScene.x3d"/>
@@ -1875,7 +1878,7 @@ ignoreSetupDownloadErrors=true
             <arg value="-xsl:${stylesheet.dir}/X3dToX3dom.xslt"/>
         </java>
         <echo message="Convert newScene.x3d to newScene.wrl using X3dToVrml97.xslt regular stylesheet"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/>
             <!-- <arg value="-t"/> saxon version and timing information -->
             <arg value="-s:newScene.x3d"/>
@@ -1883,7 +1886,7 @@ ignoreSetupDownloadErrors=true
             <arg value="-xsl:${stylesheet.dir}/X3dToVrml97.xslt"/>
         </java>
         <echo message="Convert newScene.x3d to newScene.x3dv using X3dToX3dvClassicVrmlEncoding.xslt regular stylesheet"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
             <arg value="-warnings:recover"/> 
             <arg value="-s:newScene.x3d"/>
             <arg value="-o:newScene.x3dv"/>
@@ -2150,13 +2153,13 @@ ignoreSetupDownloadErrors=true
         <property name="singleFileName"    value="AllAudioGraphNodesTest"/><!-- no file extension -->
         
         <echo>${singleFilePath}/${singleFileName}.x3d validation using X3D Schematron rules</echo>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="false">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="false">
             <arg value="-warnings:recover"/>
             <arg value="-s:${singleFilePath}"/>
             <arg value="-o:${singleFilePath}/_schematron/${singleFileName}.svrl"/> <!-- ${archive.path}/ -->
             <arg value="-xsl:${X3dSchematronValidityChecks.dir}/${X3dSchematronValidityChecks}.xslt"/>
         </java>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="false">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="false">
             <arg value="-warnings:recover"/>
             <arg value="-s:${singleFilePath}/_schematron/${singleFileName}.svrl"/>
             <arg value="-o:${singleFilePath}/_schematron/${singleFileName}.svrl.txt"/> <!-- ${archive.path}/ -->
@@ -2230,13 +2233,13 @@ ignoreSetupDownloadErrors=true
                         </xslt>
                         -->
                         <echo>@{file.path.name} validation using X3D Schematron rules</echo>
-                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="false">
+                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="false">
                             <arg value="-warnings:recover"/>
                             <arg value="-s:@{file.path.name}"/>
                             <arg value="-o:${relative.path1}/${relative.path2}/_schematron/${name.short}.svrl"/> <!-- ${archive.path}/ -->
                             <arg value="-xsl:${X3dSchematronValidityChecks.dir}/${X3dSchematronValidityChecks}.xslt"/>
                         </java>
-                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="false">
+                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="false">
                             <arg value="-warnings:recover"/>
                             <arg value="-s:${relative.path1}/${relative.path2}/_schematron/${name.short}.svrl"/>
                             <arg value="-o:${relative.path1}/${relative.path2}/_schematron/${name.short}.svrl.txt"/> <!-- ${archive.path}/ -->
@@ -2727,7 +2730,7 @@ ignoreSetupDownloadErrors=true
                         <!-- java net.sf.saxon.Transform -s:source -o:output -xsl:stylesheet -->
                         <!-- $(SAXON) -t -s:HelloWorld.x3d -o:HelloWorld.html -xsl:../X3dToXhtml.xslt -->
                         <!-- note reordering of parameters for source, output contrary to Saxon documentation! -->
-                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="${fork}">
+                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="${fork}">
                             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
                             <arg value="-s:${parentX3dSceneName}"/>
                             <arg value="-o:sceneScriptFieldGlobals.properties"/>
@@ -3567,7 +3570,7 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos
         <!-- TODO: Xj3D -captureViewpoint option, selectively adding corresponding links in output HTML -->
         <property name="reduceArchiveSize" value="false"/>
         <echo message="attempted to set immutable property to false:  reduceArchiveSize=${reduceArchiveSize}"/>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="false" failonerror="false">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="false" failonerror="false">
             <arg value="-dtd:off"/> <!-- TODO problem with different relative directories while invoking under jenkins -->
             <arg value="-warnings:recover"/> <!-- recover after writing a warning message -->
             <!-- <arg value="-t"/> saxon version and timing information -->
@@ -3941,13 +3944,13 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos
                         <!-- process individual files here.  show full path to facilitate user loading, editing of reported files -->
                         <mkdir dir="${archive.path}/${relative.path1}/${relative.path2}/_schematron"/>
                         <echo>@{file.path.name} validation using X3D Schematron rules</echo>
-                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="false">
+                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="false">
                             <arg value="-warnings:recover"/>
                             <arg value="-s:@{file.path.name}"/>
                             <arg value="-o:${relative.path1}/${relative.path2}/_schematron/${name.short}.svrl"/> <!-- ${archive.path}/ -->
                             <arg value="-xsl:${X3dSchematronValidityChecks.dir}/${X3dSchematronValidityChecks}.xslt"/>
                         </java>
-                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." fork="false">
+                        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." fork="false">
                             <arg value="-warnings:recover"/>
                             <arg value="-s:${relative.path1}/${relative.path2}/_schematron/${name.short}.svrl"/>
                             <arg value="-o:${relative.path1}/${relative.path2}/_schematron/${name.short}.svrl.txt"/> <!-- ${archive.path}/ -->
@@ -4732,7 +4735,7 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos
         </exec>
         <!-- https://www.saxonica.com/documentation9.5/using-xsl/commandline.html -->
         <echo>saxon -? help</echo>
-        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};." failonerror="true">
+        <java classname="net.sf.saxon.Transform" classpath="${saxon.dir}/${saxon.jar};${saxon.dir}/${xmlresolver.jar};." failonerror="true">
         <arg value="-?" description="help information"/>
         </java>
         <echo></echo>
-- 
GitLab