Skip to content

Instantly share code, notes, and snippets.

@eerohele
Last active December 16, 2015 09:18
Show Gist options
  • Save eerohele/5411492 to your computer and use it in GitHub Desktop.
Save eerohele/5411492 to your computer and use it in GitHub Desktop.
Saxon
#!/bin/bash
if [ -z "$RESOLVER_HOME" ]; then
echo "ERR: \$RESOLVER_HOME not set."
echo "Set \$RESOLVER_HOME to point to Apache XML Commons Resolver JAR file."
echo "See http://xerces.apache.org/"
exit 1
fi
if [ -z "$SAXON_HOME" ]; then
echo "ERR: \$SAXON_HOME not set."
echo "Set \$SAXON_HOME to point to Saxon XSLT processor JAR file."
echo "See http://saxon.sourceforge.net/"
exit 1
fi
if [ -z "$XML_CATALOG_FILES" ]; then
echo "NOTE: \$XML_CATALOG_FILES not set, using /etc/xml/catalog"
echo
XML_CATALOG_FILES=/etc/xml/catalog
fi
java -cp "$SAXON_HOME/saxon9he.jar":"$RESOLVER_HOME/resolver.jar" \
-Dxml.catalog.files="$XML_CATALOG_FILES" net.sf.saxon.Transform \
-r:org.apache.xml.resolver.tools.CatalogResolver \
-x:org.apache.xml.resolver.tools.ResolvingXMLReader \
-y:org.apache.xml.resolver.tools.ResolvingXMLReader $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment