TEIC / atop

Another TEI ODD Processor
Other
9 stars 2 forks source link

Transpile step fails silently when components are missing #21

Closed martindholmes closed 7 months ago

martindholmes commented 11 months ago

The PLODD test file no_tei_content makes use of two TEI datatypes, teidata.pointer and teidata.word, for attribute values. If those elements are missing, the transpile step simply fails silently (produces no RNG output). The question is whether this is an error that should be handled at the PLODD/transpile stage, or whether we should assume that we would have caught this error and reported it effectively at one of the earlier build steps.

dmj commented 11 months ago

The XProc transpiler step (Util/steps/transpile.xpl) removes dangling references in the PLODD. We do this because the legacy customization process (Util/steps/legacy-odd2odd.xpl, XSLT/legacy-odd2odd.xsl) removes specification elements but does not remove/modify references to those specifications. With the dangling reference to e.g. teidata.pointer removed, the e.g. datatype specification is empty and causes a dynamic XSLT failure ("An empty sequence is not allowed as the value of variable $vDataSpec").

I moved removing dangling references from transpile.xpl to the legacy-odd2odd.xpl step -- https://github.com/TEIC/atop/commit/b4d7ab92e7cc48f83bf9ddbdf85d18a2404b650e

I added a Schematron validation step that checks the input of the transpiler to be a self-contained schema specification (See #16) -- https://github.com/TEIC/atop/commit/d6286012f9962ee90e517e61455b5faadddff0a3

@martindholmes I can't see the transpile step failing silently. It stops with a dynamic error: "An empty sequence is not allowed as the value of variable $vDataSpec" or, after the two commits above, with a failed Schematron validation. It looks like the Ant target buildPloddTestSchema does not terminate if the transpilePlodd terminated with an error.

martindholmes commented 7 months ago

@sydb, @HelenaSabel and I all agree that this file should not have tei.data references in it unless the corresponding dataSpecs are there, so this is not a bug.