2015-11-04 14:37:15 +00:00
|
|
|
#!/bin/zsh
|
|
|
|
|
2018-06-25 15:59:11 +00:00
|
|
|
script_dir=${${0:a}:h}
|
|
|
|
src_dir=${script_dir}/../..
|
2015-11-04 14:37:15 +00:00
|
|
|
src_dir=${src_dir:a}
|
|
|
|
no_strip=0
|
|
|
|
|
2018-06-25 15:59:11 +00:00
|
|
|
if [[ -f ${script_dir}/conf.sh ]] source ${script_dir}/conf.sh
|
2015-11-04 14:37:15 +00:00
|
|
|
|
|
|
|
tmpi=$(mktemp)
|
|
|
|
src_file=${1}
|
|
|
|
dst_file=${2}
|
|
|
|
stylesheet=${3}
|
|
|
|
|
|
|
|
shift 3
|
|
|
|
|
|
|
|
perl -pe 's/PUBLIC.*OASIS.*dtd"//' < ${src_file} > ${tmpi}
|
|
|
|
|
2016-06-05 15:15:04 +00:00
|
|
|
java -classpath ${saxon_dir}/saxon9he.jar net.sf.saxon.Transform -o:${dst_file} -xsl:${stylesheet} ${tmpi} $@ |& \
|
2015-11-04 14:37:15 +00:00
|
|
|
perl -pe '
|
|
|
|
s{^Error\s+(at.*?)?\s*on\s+line\s+(\d+)\s+column\s+(\d+)\s+of\s+(.+?):}{\4:\2:\3: error: \1};
|
|
|
|
s{(.+?)\s+on\s+line\s+(\d+)\s+of\s+(.+)}{\3:\2: warning: \1};'
|
|
|
|
|
|
|
|
rm -f $tmpi
|
|
|
|
|
|
|
|
if [[ ! -f ${dst_file} ]] exit 1
|