[tei-council] [Fwd: Schematron example]

James Cummings James.Cummings at oucs.ox.ac.uk
Sat Apr 11 11:05:12 EDT 2009


 From Syd

-------- Original Message --------
Subject: Schematron example
Date: Sat, 11 Apr 2009 09:34:50 -0400
From: Syd Bauman <Syd_Bauman at Brown.edu>
Reply-To: Syd_Bauman at Brown.edu
To: James Cummings <james.cummings at oucs.ox.ac.uk>

James -- please forward to Council. Thanks.


I find the following example in TD.html#TDTAG problematic:

| ... note here the use of two rules within one pattern:
|  <constraint ident="tables">
|   <sch:pattern name="Tables">
|    <sch:rule context="tei:table">
|     <sch:report test="not(tei:head)">A table should have a
|         caption, using a head element</sch:report>
|     <sch:assert test="not(parent::tei:body)">Do not use tables to lay 
out the document body</sch:assert>
|    </sch:rule>
|   </sch:pattern>
|  </constraint>

1) It doesn't actually show two rules within one pattern, but rather
    two assertions/reports in one rule.

2) It doesn't mention the important bit, which is that if you have
    two (or more) <rule>s in one <pattern>, only the 1st one for which
    an element matches the context= is used.

3) The actual assertions seem backwards. Instead of
      <sch:rule context="tei:table">
        <sch:report test="not(tei:head)">A &lt;table> should have a 
caption, using a &lt;head> element</sch:report>
        <sch:assert test="not(parent::tei:body)">Do not use tables to 
lay out the document body</sch:assert>
      </sch:rule>
    I think
      <sch:rule context="tei:table">
        <sch:assert test="tei:head">A &lt;table> should have a caption, 
using a &lt;head> element</sch:assert>
        <sch:report test="parent::tei:body">Do not use tables to lay out 
the document body</sch:report>
      </sch:rule>
    is better Schematron. Am I missing something?



-- 
Dr James Cummings, Research Technologies Service, University of Oxford
James dot Cummings at oucs dot ox dot ac dot uk


More information about the tei-council mailing list