[tei-council] validUntil deprecated, so says Schematron

Syd Bauman s.bauman at neu.edu
Sun Dec 8 09:35:40 EST 2013


[Sorry I haven't kept up-to-date on the list; I hope to catch up
after doing DH reviews next weekend.]

I am working on implementing FR 459: getting the P5 Schematron to
warn users about deprecated constructs.

Sidebar: my daughter asked what I was doing while waiting for her at
karate class, and my answer was roughly
   "I'm writing XSLT code that reads in TEI-ODD code and
    writes out ISO Schematron code that will read in TEI
    instance code and write out Schematron Validation Report
    Language code, i.e., error messages."
She was unimpressed.

Anyway, I'm changing Stylesheets/extract-isosch.xsl such that it
generates Schematron code to check for constructs in instances that
have @validUntil in the ODDs.

build problem
----- -------
I haven't checked this in yet, because (of course) building P5 now
generates (appropriate) error messages, which I suspect Mr. Jenkins
won't like. Can someone remind me how I tell Mr. Jenkins that these
messages are OK? (Or is that something he can even understand?)

conceptual problem
---------- -------
The constructs that are members of att.deprecated and thus allow
@validUntil are summarized in the following "table". The second
column is what I think the Schematron should check for.

   attDef           occurrence of attr being defined
   classSpec        ?  (flag every attr?)
   constraintSpec   X
   elementSpec      occurrence of element being defined
   macroSpec        X
   moduleSpec       ?  (flag every construct?)
   schemaSpec       ?  (seems kinda silly -- flag *everything*?)
   valDesc          X
   valItem          occurrence of value being defined
   valList          X? (all values? but replacement likely looser)

My first quick take is that for constraintSpec, macroSpec, and
valDesc there is nothing we can automatically check for. I think for
attDef, elementSpec, and valItem it's pretty obvious what to check
for. But what about the others (indicated w/ "?", above)?

What does it mean (to an end user, not a schema designer) when an
attribute class has validUntil=? I lean towards saying it means every
attribute defined by that class should be flagged. 

But what about a model class? Certainly @validUntil on a model class
does not mean that the elements that are members of that class are
deprecated. But what about elements that refer to said class in their
content models? *They're* not deprecated, for sure. I lean towards
saying that what is deprecated here, if anything, is occurrences of
members of the class in elements that refer to said class.

So, e.g., if 
* A, B, and C are members of class model.noGoodAnymore,
* D refers to model.noGoodAnymore from its content model, and
* E refers directly to B in its content model; then
the Schematron should issue a warning if A, B, or C occur as a child
of D, but if B occurs as a child of E. This suggestion deliberately
ignores the possibility that A could occur in the content of F both
by direct reference and by virtue of a reference to
model.noGoodAnymore.

And if a <moduleSpec> has validUntil=, I guess we should flag every
construct defined within that module. Flagging a <schemaSpec> with
validUntil= seems so weird, I'm not sure it makes sense. (Alright,
maybe it does in TEI proper, given that an ODD may have multiple
<schemaSpec>s, but since no ODD processor does anything other than
with the first ...)

At the moment we only use validUntil= on a few elements:
   4 attDef
   1 valItem
   1 elementSpec

what I've (not) done
---- ---- ----- ----
I have added code for these three (<attDef>, <elementSpec>, and
<valItem>), and expect to add <moduleSpec> and maybe <classSpec> (I
may have to ask for help on the latter :-). I do not claim that the
code I've added for this is the cleanest or the best way to do it,
but it does seem to work.

I've also cleaned up extract-isosch.xsl a bit while I was at it.

I do NOT intend to work on <constraintSpec>, <macroSpec>,
<schemaSpec>, <valDesc>, nor <valList> unless someone convinces me
otherwise. 


suggestions
-----------
Why is <valDesc> a member of att.deprecated, but <desc> is not? What
about <gloss>, <defaultVal>, <exemplum>, or <remarks>? I think we
should consider what does and doesn't go into att.deprecated. (And I
think perhaps <schemaSpec> should not. These others, I'm not sure
of.)


More information about the tei-council mailing list