https://github.com/TEIC/TEI
Raw File
Tip revision: 6f86eb3006d815bb183e0d0d8f94a9b3357d38a4 authored by Syd Bauman on 10 September 2014, 03:37:43 UTC
Tag this version which has Schematron code in biblStruct.xml for deprecating <idno> as a direct child of <biblStruct>. I can't implement this for the upcoming release, as we have 29 cases of biblStruct/idno in P5's own bibliogrraphy.
Tip revision: 6f86eb3
p5odds.odd
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright TEI Consortium. 
Dual-licensed under CC-by and BSD2 licences 
See the file COPYING.txt for details
$Date$
$Id$
-->
<?xml-model href="http://tei.oucs.ox.ac.uk/jenkins/job/TEIP5/lastSuccessfulBuild/artifact/release/xml/tei/odd/p5odds.rnc" type="application/relax-ng-compact-syntax"?>
<?xml-model href="http://tei.oucs.ox.ac.uk/jenkins/job/TEIP5/lastSuccessfulBuild/artifact/release/xml/tei/odd/p5odds.isosch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0"
     xmlns:rng="http://relaxng.org/ns/structure/1.0"
     xmlns:sch="http://purl.oclc.org/dsdl/schematron" >
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>TEI with ODD elements</title>
        <author>Sebastian Rahtz</author>
      </titleStmt>
      <publicationStmt>
        <p> </p>
      </publicationStmt>
      <sourceDesc>
        <p>authored from scratch</p>
      </sourceDesc>
    </fileDesc>
  </teiHeader>
  <text>
    <body>
      <schemaSpec ident="p5odds" prefix="TEI_" start="TEI schemaSpec elementSpec classSpec macroSpec div">
        <moduleRef key="header"/>
        <moduleRef key="core"/>
        <moduleRef key="tei"/>
        <moduleRef key="gaiji"/>
        <moduleRef key="namesdates"/>
        <moduleRef key="textstructure"/>
        <moduleRef key="tagdocs"/>
        <moduleRef key="dictionaries"/>
        <moduleRef key="linking"/>
        <moduleRef key="figures"/>
        <elementSpec ident="div1" module="textstructure" mode="delete"/>
        <elementSpec ident="div2" module="textstructure" mode="delete"/>
        <elementSpec ident="div3" module="textstructure" mode="delete"/>
        <elementSpec ident="div4" module="textstructure" mode="delete"/>
        <elementSpec ident="div5" module="textstructure" mode="delete"/>
        <elementSpec ident="div6" module="textstructure" mode="delete"/>
        <elementSpec ident="div7" module="textstructure" mode="delete"/>
        <moduleRef url="Exemplars/svg11.rng">
          <content>
            <define xmlns="http://relaxng.org/ns/structure/1.0" combine="choice" name="tei_model.graphicLike">
              <ref name="svg"/>
            </define>
          </content>
        </moduleRef>
        <moduleRef url="Exemplars/mathml2-main.rng"/>
        <moduleRef url="Exemplars/relaxng.rng"/>
        <elementSpec ident="egXML" mode="change" module="tagdocs" ns="http://www.tei-c.org/ns/Examples">
          <content>
            <rng:zeroOrMore>
              <rng:group>
                <rng:choice>
                  <rng:text/>
                  <rng:ref name="egXML"/>
                  <rng:ref name="macro.anyXML"/>
                </rng:choice>
              </rng:group>
            </rng:zeroOrMore>
          </content>
        </elementSpec>
        <macroSpec ident="macro.anyThing" mode="add">
          <content>
            <?NameList?>
          </content>
        </macroSpec>
        <macroSpec ident="macro.schemaPattern" mode="change" module="tagdocs">
          <content>
            <group xmlns="http://relaxng.org/ns/structure/1.0">
              <choice>
                <text/>
                <oneOrMore>
                  <choice>
                    <ref name="pattern"/>
                    <ref name="define"/>
                  </choice>
                </oneOrMore>
              </choice>
            </group>
          </content>
        </macroSpec>
        <macroSpec ident="anySchematron" mode="add">
          <content>
            <element xmlns="http://relaxng.org/ns/structure/1.0">
              <nsName ns="http://www.ascc.net/xml/schematron"/>
              <zeroOrMore>
                <choice>
                  <attribute>
                    <anyName/>
                  </attribute>
                  <ref name="anySchematron"/>
                  <text/>
                </choice>
              </zeroOrMore>
            </element>
          </content>
        </macroSpec>
        <macroSpec ident="anyISOSchematron" mode="add">
          <content>
            <element xmlns="http://relaxng.org/ns/structure/1.0">
              <nsName ns="http://purl.oclc.org/dsdl/schematron"/>
              <zeroOrMore>
                <choice>
                  <attribute>
                    <anyName/>
                  </attribute>
                  <ref name="anyISOSchematron"/>
                  <text/>
                </choice>
              </zeroOrMore>
            </element>
          </content>
        </macroSpec>
        <elementSpec ident="constraint" mode="change" module="tagdocs">
          <content>
            <zeroOrMore xmlns="http://relaxng.org/ns/structure/1.0">
              <choice>
                <text/>
                <ref name="anySchematron"/>
                <ref name="anyISOSchematron"/>
              </choice>
            </zeroOrMore>
          </content>
        </elementSpec>
        <!-- in examples we'd like to be able to show use of <xi:include>; of course, -->
        <!-- we can't put in an <xi:include> element, or it will be processed! Thus, -->
        <!-- here we use a bogus namespace -->
        <elementSpec ident="include" ns="http://www.example.org/cannot/really/use/XInclude" mode="add">
          <!-- the content and attributes were devised based on my reading of the spec at
             http://www.w3.org/TR/2006/REC-xinclude-20061115/, also having looked at
             Norm Walsh's implimentation for DocBook. -sb -->
          <content>
            <optional xmlns="http://relaxng.org/ns/structure/1.0">
              <ref name="fallback"/>
            </optional>
          </content>
          <attList>
            <attDef ident="href">
              <datatype>
                <data xmlns="http://relaxng.org/ns/structure/1.0" type="anyURI">
                  <param name="pattern">[^#]+</param>
                </data>
              </datatype>
            </attDef>
            <attDef ident="parse">
              <defaultVal>xml</defaultVal>
              <valList>
                <valItem ident="xml"/>
                <valItem ident="text"/>
              </valList>
            </attDef>
            <attDef ident="xpointer">
              <datatype>
                <data xmlns="http://relaxng.org/ns/structure/1.0" type="string"/>
              </datatype>
            </attDef>
            <attDef ident="encoding">
              <datatype>
                <data xmlns="http://relaxng.org/ns/structure/1.0" type="string"/>
              </datatype>
            </attDef>
            <attDef ident="accept">
              <datatype>
                <data xmlns="http://relaxng.org/ns/structure/1.0" type="string"/>
              </datatype>
            </attDef>
            <attDef ident="accept-language">
              <datatype>
                <data xmlns="http://relaxng.org/ns/structure/1.0" type="string"/>
              </datatype>
            </attDef>
          </attList>
        </elementSpec>
        <!-- of course <xi:include> refers to <xi:fallback>, so we need to declare-->
        <!-- that, too, just in case. -->
        <elementSpec ident="fallback" ns="http://www.example.org/cannot/really/use/XInclude" mode="add">
          <content>
            <oneOrMore xmlns="http://relaxng.org/ns/structure/1.0">
              <choice>
                <text/>
                <?NameList?>
              </choice>
            </oneOrMore>
          </content>
        </elementSpec>
        <elementSpec module="tagdocs" ident="gi" mode="change">
          <attList>
            <attDef mode="replace" ident="scheme">
              <valList type="closed">
                <valItem ident="imaginary"/>
                <valItem ident="extreme">
                  <gloss>Extreme conference
            proceedings markup</gloss>
                </valItem>
                <valItem ident="DBK">
                  <gloss>Docbook</gloss>
                </valItem>
                <valItem ident="SMIL"/>
                <valItem ident="Schematron"/>
                <valItem ident="HTML"/>
                <valItem ident="SVG"/>
                <valItem ident="XHTML"/>
              </valList>
            </attDef>
          </attList>
        </elementSpec>
        <elementSpec ident="biblScope" mode="change">
          <attList>
            <attDef mode="replace" ident="type">
              <valList type="closed">
                <valItem ident="chap">
                  <gloss>Chapter</gloss>
                </valItem>
                <valItem ident="issue">
                  <gloss>Issue</gloss>
                </valItem>
                <valItem ident="note">
                  <gloss>Note</gloss>
                </valItem>
                <valItem ident="part">
                  <gloss>Part</gloss>
                </valItem>
                <valItem ident="pp">
                  <gloss>Pages</gloss>
                </valItem>
                <valItem ident="vol">
                  <gloss>Volume</gloss>
                </valItem>
              </valList>
            </attDef>
          </attList>
        </elementSpec>
        <elementSpec ident="divGen" mode="change">
          <attList>
            <attDef mode="replace" ident="type">
              <valList type="closed">
                <valItem ident="attcat">
                  <gloss>Catalogue of Attributes</gloss>
                </valItem>
                <valItem ident="attclasscat">
                  <gloss>Catalogue of Attribute Classes</gloss>
                </valItem>
                <valItem ident="elementcat">
                  <gloss> Catalogue of Elements</gloss>
                </valItem>
                <valItem ident="index">
                  <gloss> Index</gloss>
                </valItem>
                <valItem ident="macrocat">
                  <gloss> Catalogue of Macros</gloss>
                </valItem>
                <valItem ident="modelclasscat">
                  <gloss>Catalogue of Model Classes</gloss>
                </valItem>
                <valItem ident="toc">
                  <gloss>Table of Contents</gloss>
                </valItem>
              </valList>
            </attDef>
          </attList>
        </elementSpec>
        <elementSpec ident="div" mode="change">
          <attList>
            <attDef mode="replace" ident="type">
              <valList type="closed">
                <valItem ident="div1"/>
                <valItem ident="div2"/>
                <valItem ident="div3"/>
                <valItem ident="div4"/>
                <valItem ident="titlePageVerso"/>
                <valItem ident="Dedication"/>
                <valItem ident="section"/>
                <valItem ident="subsection"/>
                <valItem ident="subsubsection"/>
              </valList>
            </attDef>
          </attList>
        </elementSpec>
        <elementSpec ident="list" mode="change">
          
          <!-- MDH 2014-07-29: per https://sourceforge.net/p/tei/bugs/460, 
          changes made to specs should be reflected in Guidelines usage, so 
          the values for @type and @rend below should be reviewed. -->
          <attList>
            <attDef mode="replace" ident="type">
              <valList type="closed">
                <valItem ident="ordered">
                  <gloss>Numbered list</gloss>
                </valItem>
                <valItem ident="simple">
                  <gloss>Plain list</gloss>
                </valItem>
                <valItem ident="gloss">
                  <gloss>Glossary list</gloss>
                </valItem>
                <valItem ident="inline">
                  <gloss>Inline list</gloss>
                </valItem>
              </valList>
            </attDef>
            <attDef mode="replace" ident="rend">
              <valList type="closed">
                <valItem ident="specList">
                  <gloss>Specification list</gloss>
                </valItem>
                <valItem ident="numbered">
                  <gloss>Numbered list</gloss>
                </valItem>
                <valItem ident="ordered">
                  <gloss>Numbered list</gloss>
                </valItem>
                <valItem ident="simple">
                  <gloss>Plain list</gloss>
                </valItem>
                <valItem ident="gloss">
                  <gloss>Glossary list</gloss>
                </valItem>
                <valItem ident="inline">
                  <gloss>Inline list</gloss>
                </valItem>
<!-- MDH 2014-07-29: added this value to make changes to 
     Guidelines source valid per https://sourceforge.net/p/tei/bugs/460.                -->
                <valItem ident="bulleted">
                  <gloss>Bulleted list</gloss>
                </valItem>
              </valList>
            </attDef>
          </attList>
        </elementSpec>
        <elementSpec module="tagdocs" ident="ident" mode="change">
          <attList>
            <attDef mode="replace" ident="type">
              <valList type="closed">
                <valItem ident="field">
                  <gloss>field used in a metadata standard</gloss>
                </valItem>
                <valItem ident="ge">
                  <gloss>general entity name</gloss>
                </valItem>
                <valItem ident="rng">
                  <gloss>RELAX NG identifier</gloss>
                </valItem>
                <valItem ident="frag">
                  <gloss>DTD fragment identifier</gloss>
                </valItem>
                <valItem ident="macro"/>
                <valItem ident="ns">
                  <gloss>namespace</gloss>
                </valItem>
                <valItem ident="schema"/>
                <valItem ident="pe">
                  <gloss>parameter entity name</gloss>
                </valItem>
                <valItem ident="datatype"/>
                <valItem ident="file"/>
                <valItem ident="module"/>
                <valItem ident="class"/>
              </valList>
            </attDef>
          </attList>
        </elementSpec>

        <classSpec ident="att.translatable" mode="change" type="atts">
          <constraintSpec mode="add"
                          ident="require-translatability"
                          scheme="isoschematron">
            <constraint>
                <sch:rule context="tei:elementSpec/tei:desc
                                 | tei:elementSpec/tei:gloss
                                 | tei:elementSpec/tei:remarks
                                 | tei:classSpec/tei:desc
                                 | tei:classSpec/tei:gloss
                                 | tei:classSpec/tei:remarks
                                 | tei:macroSpec/tei:desc
                                 | tei:macroSpec/tei:gloss
                                 | tei:macroSpec/tei:remarks
                                 | tei:attDef/tei:desc
                                 | tei:attDef/tei:gloss
                                 | tei:attDef/tei:remarks
                                 | tei:valItem/tei:desc
                                 | tei:valItem/tei:gloss
                                 | tei:valItem/tei:remarks
                                 ">
                  <sch:report test="not( @xml:lang and @versionDate )">
                    Error: both the versionDate and xml:lang attributes on "<sch:name/>" are required when it is a child of "<sch:value-of select="local-name(..)"/>".
                  </sch:report>
                </sch:rule>
            </constraint>
          </constraintSpec>
          <constraintSpec ident="all-sibling-parent-desc" scheme="isoschematron">
            <constraint>
              <sch:rule context="*[tei:desc[@versionDate]]">
                <sch:report role="nonfatal" test="
                     count( tei:desc )
                     ne
                     count( tei:desc[@versionDate] )
                     ">
                  Error: sibling 'desc' elements with and without @versionDate.
                </sch:report>
              </sch:rule>
	    </constraint>
	  </constraintSpec>
          <constraintSpec ident="all-sibling-parent-gloss" scheme="isoschematron">
            <constraint>
              <sch:rule context="*[tei:gloss[@versionDate]]">
                <sch:report role="nonfatal" test="
                     count( tei:gloss )
                     ne
                     count( tei:gloss[@versionDate] )
                     ">
                  Error: sibling 'gloss' elements with and without @versionDate.
                </sch:report>
              </sch:rule>
	    </constraint>
	  </constraintSpec>
          <constraintSpec ident="all-sibling-parent-remarks" scheme="isoschematron">
            <constraint>
              <sch:rule context="*[tei:remarks[@versionDate]]">
                <sch:report role="nonfatal" test="
                     count( tei:remarks )
                     ne
                     count( tei:remarks[@versionDate] )
                     ">
                  Error: sibling 'remarks' elements with and without @versionDate.
                </sch:report>
              </sch:rule>
	    </constraint>
	  </constraintSpec>
          <constraintSpec ident="all-sibling-parent-valDesc" scheme="isoschematron">
            <constraint>
              <sch:rule context="*[tei:valDesc[@versionDate]]">
                <sch:report role="nonfatal" test="
                     count( tei:valDesc )
                     ne
                     count( tei:valDesc[@versionDate] )
                     ">
                  Error: sibling 'valDesc' elements with and without @versionDate.
                </sch:report>
              </sch:rule>
            </constraint>
          </constraintSpec>
        </classSpec>
          
        <classSpec ident="att.identified" mode="change" type="atts">
          <attList>
            <attDef ident="module" mode="replace">
              <valList type="closed" mode="add">
                <valItem ident="tei"/>
                <valItem ident="core"/>
                <valItem ident="analysis"/>
                <valItem ident="certainty"/>
                <valItem ident="corpus"/>
                <valItem ident="dictionaries"/>
                <valItem ident="drama"/>
                <valItem ident="figures"/>
                <valItem ident="gaiji"/>
                <valItem ident="header"/>
                <valItem ident="iso-fs"/>
                <valItem ident="linking"/>
                <valItem ident="msdescription"/>
                <valItem ident="namesdates"/>
                <valItem ident="nets"/>
                <valItem ident="spoken"/>
                <valItem ident="textcrit"/>
                <valItem ident="textstructure"/>
                <valItem ident="transcr"/>
                <valItem ident="verse"/>
                <valItem ident="tagdocs"/>
              </valList>
            </attDef>
          </attList>
        </classSpec>

        <elementSpec ident="exemplum" mode="change">
          <attList>
            <attDef mode="change" ident="xml:lang" usage="req"/>
          </attList>
        </elementSpec>
        <elementSpec ident="idno" mode="change">
          <attList>
            <attDef mode="replace" ident="type">
              <valList type="closed">
                <valItem ident="DOI">
                  <gloss>Digital Object Identifier</gloss>
                </valItem>
                <valItem ident="ISBN">
                  <gloss>International Standard Book Number</gloss>
                </valItem>
                <valItem ident="url">
                  <gloss>any form of web address</gloss>
                </valItem>
              </valList>
            </attDef>
          </attList>
        </elementSpec>

<elementSpec mode="change" ident="TEI">
  <constraintSpec ident="must-have-attglobal" scheme="isoschematron" mode="add">
    <constraint>
      <rule context="tei:elementSpec[not(@mode)]" xmlns="http://purl.oclc.org/dsdl/schematron">
        <assert test="tei:classes/tei:memberOf[@key='att.global']">Error: TEI element <value-of select="@ident"/> must be member of att.global class</assert>
      </rule>
    </constraint>
  </constraintSpec>
</elementSpec>
      </schemaSpec>
    </body>
  </text>
</TEI>
back to top