TEIC / Stylesheets

TEI XSL Stylesheets
232 stars 124 forks source link

DocX tests break every time the Stylesheets version changes #646

Open raffazizzi opened 10 months ago

raffazizzi commented 10 months ago

This issue only arises around release time, which makes it rare, but problematic if not documented as part of the release process. We should see whether it can be avoided.

The Stylesheets version gets baked into the expected results for docx transformations, so tests fail when the version is changed. This affects several files in Test and Test2, but it's always in the <appInfo>. One example is /Test2/testDocxIndexes1.xml:

<encodingDesc>
         <appInfo>
            <application xml:id="docxtotei" ident="TEI_fromDOCX" version="7.57.0a">
               <label>DOCX to TEI</label>
            </application>
         </appInfo>
      </encodingDesc>
sydb commented 10 months ago

[Here I am just excerpting a portion of the Slack discussion of earlier today, cleaning up and improving it a bit.]

In Test2/ we should be able to just update the "cleanForDiff" target [which is in Test2/build_utilities.xml] to knock that @version out, I think.

In Test/ I think (but am not sure) we just add it to Test/cleanup.pl. (Although I am not sure if there is any rhyme nor reason [in the Test/Makefile] for when cleanup.pl is run vs when it is not. But supposedly we could add it to any test runs that do not have it but need to ignore that attr.)


That Perl routine (Test/cleanup.pl) does not do any actual XML parsing, of course, it just does regular-expression find-and-replace. Of the 7 changes it currently makes, 6 of them (I claim) are actually best handled as they currently are: regex find-and-replace. But the 1st one of those, and this new one about @version, would be better handled with a true XML-based routine. Not at all sure it is worth the bother, though. After all, the files being processed are not hand-encoded, but rather are machine-generated, and thus completely predictable.

sydb commented 10 months ago

See PR #650.