TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
269 stars 88 forks source link

First crack at addressing #2173 in a serious way. #2442

Open sydb opened 1 year ago

sydb commented 1 year ago

Holy smoke. This has been a lot of work.

Branch name is “sydb_2173”. It builds on my local system (in a docker container), and passes the tests established on the ticket. Only possible problem I have noticed is the "unique_xmlIDs" constraint of tei_customization is not contextualizable. That is on purpose, of course. The current Stylesheets generate "@xml:id" as the value of @context, thus firing on all occurrences of @xml:id (whether the element it appears on got it via att.global or not), which is the desired effect. If necessary we can just add an <sch:rule context="@xml:id"> wrapper. (It would be added in P5/Utilities/TEI-to-tei_customization.xslt, around line 1465.)

Things I had to do to make this (putting the constraint demonstrated in the ODD attached to the ticket into constraintSpec.xml) work follow, not in any particular order.

  1. Added more informative messages to P5/Makefile and P5/antbuilder.xml
  2. In the 2nd @test in the new "context_for_constraint" constraint (the major complex one — “I am inside a <specGrp>”, “and there are one or more references to one or more of my <scpecGrp> ancestors” …) I added a clause to exclude cases of <elementSpec> inside <specGrp>. (There are 47 such cases in the Guideliens.)
  3. I added a predicate to the @context of the <sch:rule> so it is not fired if the <constraintSpec> is a descendant of an <egXML>. (This is only necessary because of how the build process does testing, I think. If you look at p5examples.isosch.xsl (very carefully) you will find that the tei: prefix is bound to the Examples namespace.)
  4. Within an XPath comment in that same @test I changed “don't” to “don’t” (i.e., U+0027 → U+2019), because the U+0027 caused Utilities/iso_dsdl_include.xsl to mis-count the parentheses, and thus broke the build.
  5. I tweaked some wording in TD. (I did not fix the incorrect prose about <sch:ns>.)
  6. I replaced expected-results/ValidatorLog.xml. Note also that in doing so I added the new comments generated by Utilities/validator.xsl and deleted a whole bunch of old warnings that, as far as I know, are long since past their usefulness.
sydb commented 9 months ago

This PR will probably never be needed, as we expect Council to simply require @context in all cases of <sch:assert> or <sch:report> within a <constraint>. But some of the work here may be useful. So we should kill this PR when the above has been done.

sabineseifert commented 1 month ago

Full Council discussion at VF2F 16 March 2024: