Skip to content

<elementSpec>

element specification

documents the structure, content, and purpose of a single element type.

Module tagdocsTDTAGTD

Attributes

@prefixspecifies a default prefix which will be prepended to all patterns relating to the element, unless otherwise stated.
Status
Optional
Datatype
0–1 occurrences of teidata.xmlName separated by whitespace

Classes and content

Member of
May contain
Contained by

cmc

linking

namesdates

spoken

verse

Note

elementSpec currently allows valList as a direct child, but this usage is deprecated and will be removed on 2027-09-01. If a valList is used to specify the content model of an element, it should be placed inside the content child of the elementSpec.

Example

<elementSpec module="tagdocs" ident="code">
  <gloss/>
  <desc>contains literal code</desc>
  <classes>
    <memberOf key="model.emphLike"/>
  </classes>
  <content>
    <textNode/>
  </content>
  <attList>
    <attDef ident="type" usage="opt">
      <desc>the language of the code</desc>
      <datatype>
        <dataRef key="teidata.enumerated"/>
      </datatype>
    </attDef>
  </attList>
</elementSpec>

Schematron

<constraintSpec xmlns:sch="http://purl.oclc.org/dsdl/schematron" scheme="schematron" ident="child-constraint-based-on-mode" xml:lang="en">
    
    <constraint>
      <sch:rule context="tei:elementSpec[ @mode eq 'delete' ]">
        <sch:report test="child::*">This &lt;elementSpec&gt; element has a @mode of "delete" even though it has child elements. Change the @mode to "add", "change", or "replace", or remove the child elements.</sch:report>
      </sch:rule>
      <sch:rule context="tei:elementSpec[ @mode = ('add','change','replace') ]">
        <sch:assert test="child::* | (@* except (@mode, @ident))">This &lt;elementSpec&gt; element has a @mode of "<sch:value-of select="@mode"/>", but does not have any child elements or schema-changing attributes. Specify child elements, use validUntil=, predeclare=, ns=, or prefix=, or change the @mode to "delete".</sch:assert>
      </sch:rule>
    </constraint>
  </constraintSpec>
<constraintSpec xmlns:sch="http://purl.oclc.org/dsdl/schematron" ident="child-valList-deprecated" scheme="schematron" xml:lang="en">
    <constraint>
      <sch:rule context="tei:elementSpec/tei:valList">
        <sch:report test="true()">
          Use of &lt;valList&gt; as a direct child of &lt;elementSpec&gt; is deprecated
          and will be invalid after 2027-08-31. To express a controlled vocabulary
          as the content model of an element, place the &lt;valList&gt; inside a
          &lt;content&gt; element.
        </sch:report>
      </sch:rule>
    </constraint>
  </constraintSpec>

Content model

<content>
    <sequence>
      <alternate minOccurs="0" maxOccurs="unbounded">
        <classRef key="model.identSynonyms"/>
        <classRef key="model.descLike"/>
      </alternate>
      <elementRef key="classes" minOccurs="0"/>
      <elementRef key="content" minOccurs="0"/>
      <elementRef key="valList" minOccurs="0"/>
      <elementRef key="constraintSpec" minOccurs="0" maxOccurs="unbounded"/>
      <elementRef key="attList" minOccurs="0"/>
      <alternate maxOccurs="unbounded" minOccurs="0">
        <elementRef key="model"/>
        <elementRef key="modelGrp"/>
        <elementRef key="modelSequence"/>
      </alternate>
      <elementRef key="exemplum" minOccurs="0" maxOccurs="unbounded"/>
      <elementRef key="remarks" minOccurs="0" maxOccurs="unbounded"/>
      <elementRef key="listRef" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </content>