TEIC / TEI

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

more examples of `@mode` on specification elements #2262

Open sydb opened 2 years ago

sydb commented 2 years ago

There are no examples (nor any discussion that I am aware of) of deleting, replacing, or altering a constraint specification. We first have to make sure that doing so actually works, of course. (If it doesn’t, that is a Stylesheets issue.)

Suggestion

[This is just a sketch of a pedagogical scenario for demonstrating these.]

A modern manuscript project uses the transcr module (Representation of Primary Sources), but they do not use the <surplus> element, and have thus removed it from their schema. Correspondingly they want to change the message issued by "substContents1" (which is “subst must have at least one child add and at least one child del or surplus”) to just “subst must have at least one child add and at least one child del” so their encoders are not faced with a message that refers to a non-existent element.

  <constraintSpec ident="substContents1" mode="change" scheme="schematron">
    <constraint>
      <sch:assert test="tei:add and tei:del"><sch:name/> must have at least one child add and at least one child del</sch:assert>
    </constraint>
  </constraintSpec>

Later on in the project’s development, the PI and lead ODD customizer decide to just enforce this constraint in the content model, and furthermore that there should always be only one <add> and one <del> in that order. Thus the entire "substContents1" constraint is no longer needed. (Here it is deleted presuming that we no longer require @scheme per #2261.)

  <elementSpec ident="subst" module="transcr" mode="change">
    <content>
      <sequence minOccurs="1" maxOccurs="1">
    <classRef key="model.milestoneLike" minOccurs="0" maxOccurs="unbounded"/>
    <elementRef key="add"/>
    <classRef key="model.milestoneLike" minOccurs="0" maxOccurs="unbounded"/>
    <elementRef key="del"/>
    <classRef key="model.milestoneLike" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
    </content>
    <constraintSpec ident="substContents1" mode="delete"/>
  </elementSpec>
martindholmes commented 1 year ago

Deleting works following Stylesheets issue #541. Tested and confirmed.

ebeshero commented 1 year ago

Council F2F Newcastle: @bleekere should work on a couple of examples to demonstrate deletion and/or replacement.

peterstadler commented 1 year ago

Council decides that this is not specifically about <constraintSpec> but rather about deleting (and adding, changing) *Spec elements in general. Potential targets for additional examples (and prose) would be https://tei-c.org/release/doc/tei-p5-doc/en/html/TD.html#TDbuild and/or https://tei-c.org/release/doc/tei-p5-doc/en/html/ref-att.combinable.html