[tei-council] Should Roma be doing this?

Martin Holmes mholmes at uvic.ca
Tue Feb 5 18:38:28 EST 2013


I have an ODD file containing this:

            <elementSpec ident="list" mode="change">
                <attList>
                   <attDef ident="type" mode="change" usage="opt">
                      <valList mode="add" type="closed">
                         <valItem ident="ordered"/>
                         <valItem ident="unordered"/>
                      </valList>
                   </attDef>

                </attList>
             </elementSpec>

When I run Roma and generate an RNG schema, it has this:

       <optional>
         <attribute 
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" 
name="type" a:defaultValue="simple">
           <a:documentation>describes the form of the 
list.</a:documentation>
           <choice>
             <value>ordered</value>
             <a:documentation/>
             <value>unordered</value>
             <a:documentation/>
           </choice>
         </attribute>
       </optional>

Note the default value of "simple". With this schema, the following 
becomes invalid:

<list>

because the processor assumes the default value of "simple" in the 
absence of the attribute (even though the attribute is optional), and 
because "simple" is not in the list of allowed values, the element is 
invalid. At least, I presume that's what's happening.

Should this be the case? Or should Roma detect when a default value is 
not included in the list of allowed values in the ODD, and discard it?

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


More information about the tei-council mailing list