@@ -9,6 +9,7 @@ on:
9 - 'test/writer.jats_articleauthoring'
9 - 'test/writer.jats_articleauthoring'
10 - 'test/writer.jats_publishing'
10 - 'test/writer.jats_publishing'
11 - 'test/writer.jats_archiving'
11 - 'test/writer.jats_archiving'
12+ - 'test/tables.jats_archiving'
12 pull_request:
13 pull_request:
@@ -17,6 +18,7 @@ on:
17 - 'test/writer.jats_articleauthoring'
18 - 'test/writer.jats_articleauthoring'
18 - 'test/writer.jats_publishing'
19 - 'test/writer.jats_publishing'
19 - 'test/writer.jats_archiving'
20 - 'test/writer.jats_archiving'
21+ - 'test/tables.jats_archiving'
@@ -31,19 +33,16 @@ jobs:
31 - articleauthoring
33 - articleauthoring
32 - publishing
34 - publishing
33 - archiving
35 - archiving
36− # tables are not supported yet, the files contain only snippets.
38 - name: Checkout
37 - name: Checkout
39 uses: actions/checkout@v2
38 uses: actions/checkout@v2
41− - name: Validate
40+ - name: Validate writer output
43− filename=test/${{ matrix.file }}.jats_${{ matrix.tagset }}
42+ filename=test/writer.jats_${{ matrix.tagset }}
44 printf "Validating file %s\n" "$filename"
43 printf "Validating file %s\n" "$filename"
45 json="$(curl --form "xml=@${filename}" --silent "$VALIDATOR_URL")"
44 json="$(curl --form "xml=@${filename}" --silent "$VALIDATOR_URL")"
46− err_count="$(echo "$json" | jq '.errors | length')"
45+ err_count="$(printf '%s' "$json" | jq '.errors | length')"
47 if [ "$err_count" -eq 0 ]; then
46 if [ "$err_count" -eq 0 ]; then
48 printf "File was validated successfully.\n"
47 printf "File was validated successfully.\n"
@@ -51,3 +50,28 @@ jobs:
51 printf "Validator report:\n%s" "$json"
50 printf "Validator report:\n%s" "$json"
54+ - name: Validate tables
55+ # Archiving has the simplest template, so we only check with that.
56+ if: matrix.tagset == 'archiving'
59+ <?xml version="1.0" encoding="utf-8" ?>
60+ <!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
61+ "JATS-archivearticle1.dtd">
62+ <article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
63+ <front><article-meta></article-meta></front>
64+ <body>%s</body></article>
67+ jats_file="$(mktemp jats-tables.XXXXX)"
68+ printf "$tmpl" "$(cat test/tables.jats_archiving)" > "$jats_file"
69+ json="$(curl --form "xml=@${jats_file}" --silent "$VALIDATOR_URL")"
70+ err_count="$(printf "%s" "$json" | jq '.errors | length')"
71+ if [ "$err_count" -eq 0 ]; then
72+ printf "Table output is valid when used as body content.\n"
75+ printf "Validator report:\n%s" "$json"