Hi Folks,
Suppose you create an XSLT program along with an input XML file. You get an
XSLT processor, install the appropriate version of Java, and get everything
running on your computer. Now suppose you want to run that same XSLT program
on another computer. Once again, you need to get the XSLT processor and the
appropriate Java installed there. In other words, everywhere you want the XSLT
program to run, you need to configure its environment.
This is what I call the environment problem.
Docker lets you avoid all that. Docker packages up the environment needed to
run the XSLT program-packages the XSLT program together with everything it
needs-so it runs consistently anywhere.
For example, I wrote an XSLT program. To get it running I downloaded the
latest Home Edition of Saxon, saxon-he-12.9.jar. I installed Java 17, OpenJDK
Runtime Environment Temurin-17.0.18+8. When I ran my XSLT program, I got an
error saying that some resolver jar files were missing: xmlresolver-5.3.3.jar
and xmlresolver-5.3.3-data.jar.
I learned that this was the complete environment I needed to run my XSLT
program:
* Java 17 runtime (OpenJDK Temurin-17.0.18+8)
* Books.xml (input XML file)
* Books-Summary.xsl (XSLT program)
* saxon-he-12.9.jar (XSLT processor)
* lib/
* xmlresolver-5.3.3.jar
* xmlresolver-5.3.3-data.jar
* the command used to run the transformation
java -cp "saxon-he-12.9.jar;lib/*" net.sf.saxon.Transform -s:Books.xml
-xsl:Books-Summary.xsl -o:Books-Summary.xml
In order for another computer to run my XSLT program, that computer would need
to match my environment. Docker lets you package that environment so you do
not have to recreate it manually on every machine.
Important: Docker does not run XSLT directly. Docker runs a container. Inside
the container, Java runs. Java runs Saxon. Saxon runs the XSLT program.
Below is a detailed, step-by-step guide showing exactly how to put your XSLT
program into Docker and run it.
________________________________
My guide is too long for the mailing list. Email me if you want it.
|