scripts/alt2xml.sh
author František Kučera <franta-hg@frantovo.cz>
Wed, 17 Sep 2014 21:06:56 +0200
changeset 100 b50e77d23d13
parent 76 56b731d14aec
child 103 5e22fa13e016
permissions -rwxr-xr-x
cli: utility option --reader-namespace-aware (shortcut for "http://xml.org/sax/features/namespaces" feature)
franta-hg@22
     1
#!/bin/bash
franta-hg@22
     2
franta-hg@22
     3
DIR="`dirname $0`/..";
franta-hg@22
     4
franta-hg@22
     5
STANDARD_JARS=(
franta-hg@22
     6
	"$DIR/java/alt2xml-cli/dist/alt2xml-cli.jar"
franta-hg@32
     7
	"$DIR/java/alt2xml-lib-input/dist/alt2xml-lib-input.jar"
franta-hg@40
     8
	"$DIR/java/alt2xml-lib-output/dist/alt2xml-lib-output.jar"
franta-hg@22
     9
);
franta-hg@22
    10
franta-hg@43
    11
INPUT_PLUGINS=(
franta-hg@22
    12
	"$DIR/java/alt2xml-in-properties/dist/alt2xml-in-properties.jar"
franta-hg@76
    13
	"$DIR/java/alt2xml-in-ini/dist/alt2xml-in-ini.jar"
franta-hg@23
    14
	
franta-hg@23
    15
	"$DIR/java/alt2xml-in-json/dist/alt2xml-in-json.jar"
franta-hg@26
    16
	"$DIR/../temp/lib/json_simple-1.1.jar"
franta-hg@22
    17
);
franta-hg@22
    18
franta-hg@43
    19
OUTPUT_PLUGINS=(
franta-hg@43
    20
	"$DIR/java/alt2xml-out-xml/dist/alt2xml-out-xml.jar"
franta-hg@51
    21
	"$DIR/java/alt2xml-out-xpath/dist/alt2xml-out-xpath.jar"
franta-hg@51
    22
	"$DIR/java/alt2xml-out-xslt/dist/alt2xml-out-xslt.jar"
franta-hg@43
    23
);
franta-hg@43
    24
franta-hg@43
    25
for e in "${STANDARD_JARS[@]}" "${INPUT_PLUGINS[@]}" "${OUTPUT_PLUGINS[@]}"; do
franta-hg@22
    26
	CLASS_PATH="$CLASS_PATH:$e";
franta-hg@22
    27
done
franta-hg@22
    28
franta-hg@54
    29
MAIN_CLASS="cz.frantovo.alt2xml.cli.CLIStarter";
franta-hg@22
    30
franta-hg@34
    31
SAX_PARSER_FACTORY_ALT="cz.frantovo.alt2xml.ParserFactory";                             # our alternative ParserFactory as default
franta-hg@34
    32
SAX_PARSER_FACTORY_XML="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";  # former default factory as fallback 
franta-hg@22
    33
franta-hg@34
    34
java \
franta-hg@34
    35
	-cp "$CLASS_PATH" \
franta-hg@34
    36
	-D"javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_ALT" \
franta-hg@34
    37
	-D"cz.frantovo.alt2xml.fallback.javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_XML" \
franta-hg@34
    38
	$MAIN_CLASS \
franta-hg@34
    39
	"$@"
franta-hg@34
    40