Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SQF and language handling of Schematron extraction process #704

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ test-oddity: actual css
else echo "==deferring: \` diff $(AR)/test.odd.html $(ER)/test.odd.html \`"; fi

$(BINDIR)/teitoodd $(FLAGS) test.odd $(AR)/test.processedodd
$(SAXON) $(AR)/test.processedodd ../odds/extract-isosch.xsl > $(AR)/test.isosch
$(SAXON) $(AR)/test.processedodd ../odds/extract-isosch.xsl lang=en > $(AR)/test.isosch
perl -i -p -e 's/This file generated [0-9T:Z-]+ by .extract-isosch.xsl./DELETED TIMESTAMP/' $(AR)/test.isosch
if [ $(DIFFNOW) -eq 1 ]; \
then diff $(AR)/test.isosch $(ER)/test.isosch; \
Expand Down
148 changes: 39 additions & 109 deletions Test/expected-results/test.isosch

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions Test2/build_odd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@
<target name="extractSchematronFromOdd">
<description>
TARGET extractSchematronFromOdd
This target uses Stylesheets/odds/extract-isosch.xsl to
extract the Schematron embedded in an ODD file. It takes
a single parameter inFile, the name of the ODD file, and creates
a single Schematron file, outputFiles/[oddFileNameWithoutExtension]FromOdd.sch.
This target uses Stylesheets/odds/extract-isosch.xsl to extract
the Schematron embedded in an ODD file. It takes two parameters:
inFile, the name of the ODD file, and lang, the natural language
of the constraints from which to extract Schematron. It creates
a single Schematron file:
outputFiles/[oddFileNameWithoutExtension]FromOdd.sch.
</description>
<basename file="${inFile}" property="plainFileName" suffix=".odd"/>
<property name="schFromOddFile" value="${outputDir}/${plainFileName}FromOdd.sch"/>
Expand All @@ -178,6 +180,7 @@
<arg value="-o:${schFromOddFile}"/>
<arg value="--suppressXsltNamespaceCheck:on"/>
<arg value="-versionmsg:off"/>
<arg value="lang=en"/>
</java>

</target>
Expand Down
2 changes: 1 addition & 1 deletion bin/transformtei
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ case $format in
;;
esac

echo Convert ${indir}/${infilename} to ${outdir}/${outfilename} \($from to $to\) using profile $profile $debug $fileperpage $splitLevel $viewportwidth $viewportheight
echo Convert ${indir}/${infilename} to ${outdir}/${outfilename} \($from to $to\) using profile $profile $debug $fileperpage $splitLevel $viewportwidth $viewportheight lang=$lang
ant $antflag -f "$APPHOME/$format/build-$direction.xml" \
-lib "${SAXONJAR}" $debug \
$fileperpage $cssFile $splitLevel $viewportwidth $viewportheight $summaryDoc $mediaoverlay $nocompress \
Expand Down
2 changes: 1 addition & 1 deletion debian-tei-xsl/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ tei-xsl (7.58.0a) natty; urgency=low

* new release from upstream

-- TEI <[email protected]> Tue, 29 Oct 2024 12:23:38 -0400
-- TEI <[email protected]> Thu, 24 Oct 2024 20:09:41 -0400

tei-xsl (7.57.0a) natty; urgency=low

Expand Down
278 changes: 156 additions & 122 deletions odds/extract-isosch.xsl

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion schematron/build-to.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@
<odd2odd in="${inputFile}" out="${inputFile}.processedodd"/>
<xslt processor="trax" force="yes" style="${profiledir}/${profile}/schematron/to.xsl" in="${inputFile}.processedodd" out="${outputFile}">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<param name="lang" expression="${lang}" if="lang"/>
</xslt>
<delete file="${inputFile}.processedodd"/>
<!-- Temporarily removed in order to make it easier to debug
sydb_702_schematron_extraction branch:
<delete file="${inputFile}.processedodd"/>
Should probably be re-instated before that branch is merged
into dev. -->
</target>

<target name="notodd" unless="processODD">
Expand Down
Loading