[tei-council] @min and @max

Martin Holmes mholmes at uvic.ca
Tue Jun 19 15:53:38 EDT 2012


In the IRC chatroom, something came up that we need to look at.

There's a test in P5-Test which we think should be failing, but it's not 
failing. It's called testcardinality, and consists of:

/trunk/P5/Test/testcardinality.odd
                testcardinality.xml

The ODD file creates a constraint on the number of times a member of 
model.lLike can appear inside a parent:

<schemaSpec ident="testcardinality">
           <moduleRef key="tei"/>
           <moduleRef key="core"/>
           <moduleRef key="header"/>
           <moduleRef key="textstructure"/>
	  <elementSpec ident="l" mode="change">
	    <classes mode="replace">
	      <memberOf key="att.global"/>
	      <memberOf key="att.metrical"/>
	      <memberOf key="att.enjamb"/>	
	      <memberOf key="model.lLike" min="2" max="6"/>
	    </classes>
	  </elementSpec>
       </schemaSpec>

And the test.xml file has an <lg> which clearly violates that constraint:

           <lg>
<!--  Why doesn't this fail validation? It should, surely. MDH 
2012-06-19.          -->
             <l>Bent double, like old beggars under sacks, </l>
           </lg>

(It has only one <l>.)

I'm pretty sure that DTDs cannot support min and max occurrence 
constraints, but I think RNGs should; the RNG generated from this ODD 
file, however, allows a single model.lLike to occur:

<group>
         <zeroOrMore>
           <choice>
             <ref name="model.divTop"/>
             <ref name="model.global"/>
           </choice>
         </zeroOrMore>
         <choice>
           <ref name="model.lLike"/>
           <ref name="model.stageLike"/>
           <ref name="model.labelLike"/>
           <ref name="lg"/>
         </choice>
         <zeroOrMore>
           <choice>
             <ref name="model.lLike"/>
             <ref name="model.stageLike"/>
             <ref name="model.labelLike"/>
             <ref name="model.global"/>
             <ref name="lg"/>
           </choice>
         </zeroOrMore>
         <zeroOrMore>
           <group>
             <ref name="model.divBottom"/>
           </group>
           <zeroOrMore>
             <ref name="model.global"/>
           </zeroOrMore>
         </zeroOrMore>
       </group>

So my question is: is this supposed to work? If so, is it supposed to 
work in RNG files? And if so, is this an example of an ODD processing error?

If it's not supposed to work -- if it's just a feature of ODD, and not 
of schemas we currently generate from ODD -- then we can just switch off 
this test for the moment. But I don't know the background to @min and 
@max well enough to understand what should be happening.

Cheers,
Martin
-- 
Martin Holmes
University of Victoria Humanities Computing and Media Centre
(mholmes at uvic.ca)


More information about the tei-council mailing list