scripts/alt2xml.sh
author František Kučera <franta-hg@frantovo.cz>
Mon, 16 Jun 2014 22:29:02 +0200
changeset 51 d79b818c364b
parent 43 058c1c39251e
child 54 3d5cc308e268
permissions -rwxr-xr-x
alt2xml.sh: xpath and xslt JARs
     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 	
    14 	"$DIR/java/alt2xml-in-json/dist/alt2xml-in-json.jar"
    15 	"$DIR/../temp/lib/json_simple-1.1.jar"
    16 );
    17 
    18 OUTPUT_PLUGINS=(
    19 	"$DIR/java/alt2xml-out-xml/dist/alt2xml-out-xml.jar"
    20 	"$DIR/java/alt2xml-out-xpath/dist/alt2xml-out-xpath.jar"
    21 	"$DIR/java/alt2xml-out-xslt/dist/alt2xml-out-xslt.jar"
    22 );
    23 
    24 for e in "${STANDARD_JARS[@]}" "${INPUT_PLUGINS[@]}" "${OUTPUT_PLUGINS[@]}"; do
    25 	CLASS_PATH="$CLASS_PATH:$e";
    26 done
    27 
    28 MAIN_CLASS="cz.frantovo.alt2xml.cli.CLI";
    29 
    30 SAX_PARSER_FACTORY_ALT="cz.frantovo.alt2xml.ParserFactory";                             # our alternative ParserFactory as default
    31 SAX_PARSER_FACTORY_XML="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";  # former default factory as fallback 
    32 
    33 java \
    34 	-cp "$CLASS_PATH" \
    35 	-D"javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_ALT" \
    36 	-D"cz.frantovo.alt2xml.fallback.javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_XML" \
    37 	$MAIN_CLASS \
    38 	"$@"
    39