scripts/alt2xml.sh
author František Kučera <franta-hg@frantovo.cz>
Sun, 08 Jun 2014 09:53:51 +0200
changeset 36 ad36a104623f
parent 34 5af9c7693d70
child 40 4afb00b7b1a9
permissions -rwxr-xr-x
use AltInputSource instead of just systemId in canRead() and findReader()
     1 #!/bin/bash
     2 
     3 DIR="`dirname $0`/..";
     4 
     5 STANDARD_JARS=(
     6 	"$DIR/java/alt2xml-cli/dist/alt2xml-cli.jar"
     7 	"$DIR/java/alt2xml-lib-input/dist/alt2xml-lib-input.jar"
     8 );
     9 
    10 PLUGINS=(
    11 	"$DIR/java/alt2xml-in-properties/dist/alt2xml-in-properties.jar"
    12 	
    13 	"$DIR/java/alt2xml-in-json/dist/alt2xml-in-json.jar"
    14 	"$DIR/../temp/lib/json_simple-1.1.jar"
    15 );
    16 
    17 for e in "${STANDARD_JARS[@]}" "${PLUGINS[@]}"; do
    18 	CLASS_PATH="$CLASS_PATH:$e";
    19 done
    20 
    21 MAIN_CLASS="cz.frantovo.alt2xml.cli.CLI";
    22 
    23 SAX_PARSER_FACTORY_ALT="cz.frantovo.alt2xml.ParserFactory";                             # our alternative ParserFactory as default
    24 SAX_PARSER_FACTORY_XML="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";  # former default factory as fallback 
    25 
    26 java \
    27 	-cp "$CLASS_PATH" \
    28 	-D"javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_ALT" \
    29 	-D"cz.frantovo.alt2xml.fallback.javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_XML" \
    30 	$MAIN_CLASS \
    31 	"$@"
    32