XSLT 2.0 transformation via linux shell

Alp picture Alp · Dec 16, 2011 · Viewed 11k times · Source

I want to perform an XSLT 2.0 transformation by the use of command line executions. I heard that i could use the Saxon library by a shell command like java -jar sax.jar -input foo.xml -xsl foo.xsl -output bar.xml. Does anyone know how exactly i can achieve that goal?

By the way, i am not limited to Java. Any other shell solution is fine.

Answer

Martin Honnen picture Martin Honnen · Dec 16, 2011

The documentation of Saxon is online: http://www.saxonica.com/documentation/#!using-xsl/commandline. So you need java -jar saxon9he.jar -xsl:foo.xsl -s:foo.xml -o:bar.xml.