Type-list.odd

This ODD demonstrates how to replace an attribute that a TEI element inherits from a class with a locally defined one, e.g., to add a controlled vocabulary. In this case, the type= attribute of &lt;div> is modified.

     Sample ODD for Constraining type of div  Syd Bauman   Intended for publication as an example TEI P5 customization on TEI Wiki © 2010 Syd Bauman and Brown University Women Writer's       Project. Available under the GFDL.   Born digital, based on the WWP EMPB schema. </sourceDesc> </fileDesc> <revisionDesc> <change when="2011-09-01" who="#SB"> fix typos in comments fix typo in start : div1 -> div improve introductory prose add desc</gi> added revisionDesc</gi> </revisionDesc> </teiHeader> <divGen type="toc"/> Introduction This TEI ODD file (and thus the derived schema or reference       documentation you may be reading) is the technical specification of a toy schema that exists just to demonstrate how one constrains the value of an attribute that is normally inherited from a class. In this case, the type attribute of div</gi> will be constrained to a       semi-controlled vocabulary. <specList> <specDesc key="div" atts="type"/> </specList> Modifying the definition of an attribute on a given element when that element normally inherits that attribute from a class is a bit tricky. The main <soCalled>gotcha</soCalled> is that we     intuitively expect the mode attribute of      classes</gi> to be inherited from its parent elementSpec</gi>. But classes</gi> has its own mode attribute (rather than inheriting it from <name     type="class">att.combinable ), for which the default value is replace. Thus we need to specify classes mode="change". <schemaSpec ident="div-type-list" prefix="dtl_" start="teiCorpus TEI text body div"> <moduleRef key="tei"/> <moduleRef key="header"/> <moduleRef key="core"/> <moduleRef key="textstructure"/>

<elementSpec ident="div" module="core" mode="change"> <memberOf key="att.typed" mode="delete"/> <attList> <attDef ident="type" mode="replace" usage="req"> allows user to choose one of three pre-determined values, or to fill in her own value, which in theory should express what kind of subdivision of the front, body, or back of the text this is, but in fact are just useless demonstrations <datatype minOccurs="1" maxOccurs="1"> <rng:ref name="data.enumerated"/> <valList type="semi"> <valItem ident="tst1"> test one a boring test string </valItem> <valItem ident="tst2"> test two another boring test string </valItem> <valItem ident="tst3"> test three yet another boring test string </valItem> </valList> </attDef> </attList> </elementSpec>

</schemaSpec> </TEI>