saxon10/saxon10.saxonq.script

47 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#
# saxon10q script
# JPackage Project <http://www.jpackage.org/>
. /usr/share/java-utils/java-functions
MAIN_CLASS=net.sf.saxon.Query
BASE_JARS="saxon10 xml-commons-apis jaxp_parser_impl"
# Optional jars
CLASSPATH="$CLASSPATH:"$(build-classpath \
icu4j \
jdom \
jdom2 \
xml-commons-resolver \
xom \
2>/dev/null) || :
# If we have resolver, add the CatalogManager.properties dir to CLASSPATH,
# and tweak command line options so that it's used.
args=
if echo "$CLASSPATH" | grep xml-commons-resolver >/dev/null 2>&1 && test -r /etc/java/resolver/CatalogManager.properties; then
CLASSPATH="$CLASSPATH:/etc/java/resolver"
# Tune options to use resolver.
r=org.apache.xml.resolver.tools.ResolvingXMLReader
for opt in -x ; do
if ! echo $@ | grep "\\${opt}:" >/dev/null 2>&1 ; then
args="$args ${opt}:$r"
fi
done
r=org.apache.xml.resolver.tools.CatalogResolver
if ! echo $@ | grep "\\-r:" >/dev/null 2>&1 ; then
args="$args -r:$r"
fi
fi
# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run $args "$@"