Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
include the correct modules in the autogenerated ODD.
  • Loading branch information
EsGeh authored and EsGeh committed Aug 9, 2019
1 parent 93dbab1 commit 567702b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scripts/local_stylesheet.sh
Expand Up @@ -15,7 +15,7 @@ STYLESHEET_DIR="$BASE_DIR/stylesheets"
NAME_PATTERN='*'
SUFFIX='.xml'
CACHE=
SAXON_ARGS=
SAXON_ARGS=()

OUTPUT_DIR=

Expand Down Expand Up @@ -82,7 +82,7 @@ while [[ $# > 0 ]]; do
;;
-o | --options)
shift
SAXON_ARGS="$SAXON_ARGS $1"
SAXON_ARGS+=( "$1" )
shift
;;
-c | --cache)
Expand Down Expand Up @@ -137,7 +137,7 @@ java -jar "$DEP_DIR/Stylesheets/lib/saxon9he.jar"
"$STYLESHEET_DIR/$STYLESHEET"
-s:"$file"
-o:"$OUTPUT_DIR/$output"
$SAXON_ARGS
${SAXON_ARGS[*]}
EOF
if [[ $CACHE ]] && [[ -e $OUTPUT_DIR/$output ]]; then
echo "'$OUTPUT_DIR/$output' already exists, skipping..."
Expand Down
4 changes: 3 additions & 1 deletion scripts/rnc_analysis_to_odd.sh
Expand Up @@ -30,7 +30,7 @@ function print_help {
echo " -h | --help: print this help"
echo " -i|--input-dir INPUT. directory containing analysis results created by $SCRIPT_DIR/rnc_analyse.sh. default: '$input_dir'"
echo " -o|--output-dir OUTPUT_DIR. default: '$output_dir'"
echo " -m|--modules 'MODULE1 MODULE2'. Overwrite which TEI modules to include"
echo " -m|--modules 'MODULE1,MODULE2'. Overwrite which TEI modules to include"
echo " -v|--verbosity (0: only errors, 1: warnings, 2: info, 3: debug). default: $verbosity"
echo " -d|--debug-module VAL (multiple options accumulate): send debug messages for the specific module"
}
Expand Down Expand Up @@ -90,6 +90,8 @@ fi

if [[ "$modules" != "" ]]; then
module_param="modules=$modules"
else
module_param=
fi

mkdir -p "$output_dir"
Expand Down
1 change: 1 addition & 0 deletions scripts/update_output.sh
Expand Up @@ -104,6 +104,7 @@ $SCRIPT_DIR/rnc_analysis_to_odd.sh \
--verbosity 3 \
--input-dir "$INTERMEDIATE_DIR/s2/prepare/rnc_analysis" \
--output-dir "$INTERMEDIATE_DIR/s2/odd" \
--modules 'core,tei,header,namesdates,figures,transcr,linking,textstructure' \
>$INTERMEDIATE_DIR/s2/logs/rnc_analysis_to_odd.log \
2>&1

Expand Down
7 changes: 4 additions & 3 deletions stylesheets/rng_to_odd/analysis_to_odd.xsl
Expand Up @@ -20,7 +20,8 @@
<import href="analysis_to_odd/define_to_schematron.xsl"/>

<!-- parameters: -->
<param name="modules" as="xs:string*" select="('tei','header','core','textstructure')"/>
<param name="modules" as="xs:string" select="'tei,header,core,textstructure'"/>
<param name="modules_to_include" as="xs:string*" select="tokenize($modules,',')"/>
<param name="analysis_dir" as="xs:string" required="yes"/>
<param name="input_filename" required="yes"/>
<param name="print_rng" as="xs:boolean" select="true()"/>
Expand All @@ -45,7 +46,7 @@

<!-- entry point: -->
<template match="/">
<value-of select="eoa:info(concat('modules to include: ', string-join($modules, ', ')))"/>
<value-of select="eoa:info(concat('modules to include: ', string-join($modules_to_include, ', ')))"/>

<value-of select="eoa:debug(concat('input_dir: ', $analysis_dir))"/>

Expand Down Expand Up @@ -75,7 +76,7 @@
<element name="schemaSpec" namespace="{$tei_namespace}">
<attribute name="ident">ODDfromRnc</attribute>
<!-- modules: -->
<for-each select="$modules">
<for-each select="$modules_to_include">
<element name="moduleRef" namespace="{$tei_namespace}">
<attribute name="key"><value-of select="."/></attribute>
</element>
Expand Down

0 comments on commit 567702b

Please sign in to comment.