scripts/alt2xml.sh
author František Kučera <franta-hg@frantovo.cz>
Sun, 15 Nov 2020 20:20:39 +0100
changeset 116 94081a55bf41
parent 103 5e22fa13e016
permissions -rwxr-xr-x
Added tag v0.2 for changeset 96e1125c8500
     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 	"$DIR/java/alt2xml-lib-output/dist/alt2xml-lib-output.jar"
     9 );
    10 
    11 INPUT_PLUGINS=(
    12 	"$DIR/java/alt2xml-in-properties/dist/alt2xml-in-properties.jar"
    13 	"$DIR/java/alt2xml-in-ini/dist/alt2xml-in-ini.jar"
    14 	"$DIR/java/alt2xml-in-fs/dist/alt2xml-in-fs.jar"
    15 	
    16 	"$DIR/java/alt2xml-in-json/dist/alt2xml-in-json.jar"
    17 	"$DIR/../temp/lib/json_simple-1.1.jar"
    18 );
    19 
    20 OUTPUT_PLUGINS=(
    21 	"$DIR/java/alt2xml-out-xml/dist/alt2xml-out-xml.jar"
    22 	"$DIR/java/alt2xml-out-xpath/dist/alt2xml-out-xpath.jar"
    23 	"$DIR/java/alt2xml-out-xslt/dist/alt2xml-out-xslt.jar"
    24 );
    25 
    26 for e in "${STANDARD_JARS[@]}" "${INPUT_PLUGINS[@]}" "${OUTPUT_PLUGINS[@]}"; do
    27 	CLASS_PATH="$CLASS_PATH:$e";
    28 done
    29 
    30 MAIN_CLASS="cz.frantovo.alt2xml.cli.CLIStarter";
    31 
    32 SAX_PARSER_FACTORY_ALT="cz.frantovo.alt2xml.ParserFactory";                             # our alternative ParserFactory as default
    33 SAX_PARSER_FACTORY_XML="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";  # former default factory as fallback 
    34 
    35 java \
    36 	-cp "$CLASS_PATH" \
    37 	-D"javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_ALT" \
    38 	-D"cz.frantovo.alt2xml.fallback.javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_XML" \
    39 	$MAIN_CLASS \
    40 	"$@"
    41