<?xml version="1.0" encoding="UTF-8"?>
<!-- © TEI Consortium. Dual-licensed under CC-by and BSD2 licenses; see the file COPYING.txt for details. -->
<?xml-model href="https://jenkins.tei-c.org/job/TEIP5-dev/lastSuccessfulBuild/artifact/P5/release/xml/tei/odd/p5.nvdl" type="application/xml" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?>
<elementSpec xmlns="http://www.tei-c.org/ns/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xml:id="gi-model" ident="model" module="tagdocs">
  <desc versionDate="2015-05-15" xml:lang="en">describes the processing intended for a specified
    element.</desc>
  <classes>
    <memberOf key="att.global"/>
    <memberOf key="att.predicate"/>
  </classes>
  <content>
    <sequence>
      <alternate minOccurs="0" maxOccurs="unbounded">
        <classRef key="model.identEquiv"/>
        <classRef key="model.descLike"/>
      </alternate>
      <elementRef key="param" minOccurs="0" maxOccurs="unbounded"/>
      <elementRef key="outputRendition" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </content>
  <constraintSpec scheme="schematron" ident="no_dup_default_models" xml:lang="en">
    <desc versionDate="2016-10-01" xml:lang="en">It is ambigous to have 2 <gi>model</gi>s
      that have both the same <att>output</att> and have no <att>predicate</att>
      (and thus select the same set of nodes).</desc>
    <!-- We cannot possibly check, in general, that two
         <att>predicate</att>s select the same set of nodes or not.
         But if two <att>predicate</att>s are equal (or two
         <gi>model</gi>s do not have <att>predicate</att>s), then they
         will select the same set of nodes. -->
    <constraint>
      <sch:rule context="tei:model[ not( parent::tei:modelSequence ) ][ not( @predicate ) ]">
        <sch:let name="output" value="normalize-space( @output )"/>
        <sch:report test="following-sibling::tei:model [ not( @predicate )] [ normalize-space( @output ) eq $output ]">
          There are 2 (or more) 'model' elements in this '<sch:value-of select="local-name(..)"/>'
          that have no predicate, but are targeted to the same output
          ("<sch:value-of select="( $output, parent::modelGrp/@output, 'all')[1]"/>")</sch:report>
      </sch:rule>
    </constraint>
  </constraintSpec>
  <constraintSpec scheme="schematron" ident="no_dup_models" xml:lang="en">
    <desc versionDate="2016-10-01" xml:lang="en">It is ambigous to have 2 <gi>model</gi>s
      that have both the same <att>output</att> and the same <att>predicate</att>
      (and thus select the same set of nodes).</desc>
    <constraint>
      <sch:rule context="tei:model[ not( parent::tei:modelSequence ) ][ @predicate ]">
        <sch:let name="predicate" value="normalize-space( @predicate )"/>
        <sch:let name="output" value="normalize-space( @output )"/>
        <sch:report test="following-sibling::tei:model [ normalize-space( @predicate ) eq $predicate ] [ normalize-space( @output ) eq $output ]">
          There are 2 (or more) 'model' elements in this
          '<sch:value-of select="local-name(..)"/>' that have
          the same predicate, and are targeted to the same output
          ("<sch:value-of select="( $output, parent::modelGrp/@output, 'all')[1]"/>")</sch:report>
      </sch:rule>
    </constraint>
  </constraintSpec>
  <attList>
    <attDef ident="behaviour" usage="req">
      <desc versionDate="2015-08-21" xml:lang="en">names the process or function which this
        processing model uses in order to produce output.</desc>
      <datatype>
        <dataRef key="teidata.enumerated"/>
      </datatype>
      <valList type="semi">
        <valItem ident="alternate">
          <desc versionDate="2015-08-21" xml:lang="en">support display of alternative
            visualisations, for example by displaying the preferred content, by displaying both in
            parallel, or by toggling between the two.</desc>
          <paramList>
            <paramSpec ident="default">
              <desc versionDate="2015-08-21" xml:lang="en">supplies the preferred content</desc>
            </paramSpec>
            <paramSpec ident="alternate">
              <desc versionDate="2015-08-21" xml:lang="en">supplies the alternative content</desc>
            </paramSpec>
          </paramList>
        </valItem>
        <valItem ident="anchor">
          <desc versionDate="2015-08-21" xml:lang="en">create an identifiable anchor point in the
            output.</desc>
          <paramList>
            <paramSpec ident="id">
              <desc versionDate="2016-01-22" xml:lang="en">supplies an identifier for the anchor
                point</desc>
            </paramSpec>
          </paramList>
          <!-- why wouldnt this be xml:id ? -->
        </valItem>
        <valItem ident="block">
          <desc versionDate="2015-08-21" xml:lang="en">create a block structure</desc>
          <equiv name="div"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="body">
          <desc versionDate="2015-08-21" xml:lang="en">create the body of a document.</desc>
          <equiv name="body"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="break">
          <desc versionDate="2015-08-21" xml:lang="en">create a line, column, or page break
            according to the value of <ident>type</ident></desc>
          <paramList>
            <paramSpec ident="type"/>
            <paramSpec ident="label"/>
          </paramList>
        </valItem>
        <valItem ident="cell">
          <desc versionDate="2015-08-21" xml:lang="en">create a table cell</desc>
          <equiv name="td"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="cit">
          <desc versionDate="2015-08-21" xml:lang="en">show the content, with an indication of the
            source</desc>
          <paramList>
            <paramSpec ident="content"/>
            <paramSpec ident="source"/>
          </paramList>
        </valItem>
        <valItem ident="document">
          <desc versionDate="2015-08-21" xml:lang="en">start a new output document</desc>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="figure">
          <desc versionDate="2015-08-21" xml:lang="en">make a figure with the <term>title</term> as
            caption</desc>
          <equiv name="div"/>
          <paramList>
            <paramSpec ident="title"/>
          </paramList>
        </valItem>
        <valItem ident="glyph">
          <desc versionDate="2015-08-21" xml:lang="en">show a character by looking up reference to a
            chardesc at the given URI</desc>
          <paramList>
            <paramSpec ident="uri"/>
          </paramList>
        </valItem>
        <valItem ident="graphic">
          <desc versionDate="2015-08-21" xml:lang="en">if <ident>url</ident> is present, uses it to
            display graphic, else display a placeholder image.</desc>
          <equiv name="img"/>
          <paramList>
            <paramSpec ident="url">
              <desc versionDate="2015-08-21" xml:lang="en">url of image file</desc>
            </paramSpec>
            <paramSpec ident="width">
              <desc versionDate="2015-08-21" xml:lang="en">desired width of image</desc>
            </paramSpec>
            <paramSpec ident="height">
              <desc versionDate="2015-08-21" xml:lang="en">desired height of image</desc>
            </paramSpec>
            <paramSpec ident="scale">
              <desc versionDate="2015-08-21" xml:lang="en">scaling for image</desc>
            </paramSpec>
            <paramSpec ident="title">
              <desc versionDate="2015-08-21" xml:lang="en">title of figure (usually not displayed
                directly)</desc>
            </paramSpec>
          </paramList>
        </valItem>
        <valItem ident="heading">
          <desc versionDate="2015-08-21" xml:lang="en">creates a heading.</desc>
          <equiv name="span"/>
          <paramList>
            <paramSpec ident="content"/>
            <paramSpec ident="level"/>
          </paramList>
        </valItem>
        <valItem ident="index">
          <desc versionDate="2015-08-21" xml:lang="en">generate list according to
              <ident>type</ident>.</desc>
          <paramList>
            <paramSpec ident="type"/>
          </paramList>
        </valItem>
        <valItem ident="inline">
          <desc versionDate="2015-08-21" xml:lang="en">creates inline element out of
              <ident>content</ident>
            <!--if there's something in <gi>outputRendition</gi>, use that
            formatting otherwise just show text of selected content.--></desc>
          <equiv name="span"/>
          <paramList>
            <paramSpec ident="content"/>
            <paramSpec ident="label"/>
            <!-- does what ? -->
          </paramList>
        </valItem>
        <valItem ident="link">
          <desc versionDate="2015-08-21" xml:lang="en">create hyperlink</desc>
          <equiv name="a"/>
          <paramList>
            <paramSpec ident="content"/>
            <paramSpec ident="uri">
              <desc versionDate="2015-08-21" xml:lang="en">link url</desc>
            </paramSpec>
          </paramList>
        </valItem>
        <valItem ident="list">
          <desc versionDate="2015-08-21" xml:lang="en">create a list.
            <!--by following
              <term>content</term>--></desc>
          <equiv name="ol"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="listItem">
          <desc versionDate="2015-08-21" xml:lang="en">create a list item.</desc>
          <equiv name="li"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="metadata">
          <desc versionDate="2015-08-21" xml:lang="en">create metadata section</desc>
          <!-- eh what? -->
          <equiv name="head"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="note">
          <desc versionDate="2015-08-21" xml:lang="en">create a note, often out of line, depending
            on the value of <ident>place</ident>; could be margin, footnote, endnote, inline</desc>
          <paramList>
            <paramSpec ident="content"/>
            <paramSpec ident="place"/>
            <paramSpec ident="label"/>
          </paramList>
        </valItem>
        <valItem ident="omit">
          <desc versionDate="2015-08-21" xml:lang="en">do nothing, do not process children</desc>
        </valItem>
        <valItem ident="paragraph">
          <desc versionDate="2015-08-21" xml:lang="en">create a paragraph out of
              <ident>content</ident>.</desc>
          <equiv name="p"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <!-- how is this different from block ? -->
        <valItem ident="row">
          <desc versionDate="2015-08-21" xml:lang="en">create a table row</desc>
          <equiv name="tr"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="section">
          <desc versionDate="2015-08-21" xml:lang="en">create a new section of the output
            document</desc>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="table">
          <desc versionDate="2015-08-21" xml:lang="en">create a table</desc>
          <equiv name="table"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="text">
          <desc versionDate="2015-08-21" xml:lang="en">create literal text</desc>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
        <valItem ident="title">
          <desc versionDate="2015-08-21" xml:lang="en">create document title</desc>
          <equiv name="title"/>
          <paramList>
            <paramSpec ident="content"/>
          </paramList>
        </valItem>
      </valList>
    </attDef>
    <attDef ident="useSourceRendition" usage="opt">
      <desc versionDate="2015-08-21" xml:lang="en">whether to obey any rendition attribute that is
        present.</desc>
      <datatype>
        <dataRef key="teidata.truthValue"/>
      </datatype>
      <remarks versionDate="2016-02-23" xml:lang="en">
        <p>If the <att>useSourceRendition</att> attribute is not specified, or has the value
            <val>false</val>, any renditional information specified in the source document should be
          ignored. </p>
      </remarks>
    </attDef>
    <attDef ident="output" usage="opt">
      <desc versionDate="2015-08-21" xml:lang="en">the intended output.</desc>
      <datatype>
        <dataRef key="teidata.enumerated"/>
      </datatype>
      <valList type="open">
        <valItem ident="web">
          <desc versionDate="2015-08-21" xml:lang="en">the output is intended for presentation in a
            web format</desc>
        </valItem>
        <valItem ident="print">
          <desc versionDate="2015-08-21" xml:lang="en">the output is intended for presentation in a
            print format</desc>
        </valItem>
        <valItem ident="plain">
          <desc versionDate="2015-08-21" xml:lang="en">the output is intended for presentation in a
            plain text format</desc>
        </valItem>
      </valList>
      <remarks versionDate="2016-02-23" xml:lang="en">
        <p>If the <att>output</att> attribute is not specified, this model is assumed to apply for
          all forms of output. </p>
      </remarks>
    </attDef>
    <attDef ident="cssClass" usage="opt">
      <desc versionDate="2015-08-21" xml:lang="en">the name of a CSS class which should be
        associated with this element</desc>
      <datatype maxOccurs="unbounded">
        <dataRef key="teidata.name"/>
      </datatype>
    </attDef>
  </attList>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-da" source="#UND">
      <model behaviour="inline"/>
    </egXML>
  </exemplum>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-hb">
      <elementSpec mode="change" ident="quote">
        <model predicate="ancestor::p" behaviour="inline">
          <desc versionDate="2015-08-21" xml:lang="en">If it's inside a paragraph then it's
            inline</desc>
        </model>
        <model predicate="not(ancestor::p)" behaviour="block">
          <desc versionDate="2015-08-21" xml:lang="en">If it's not inside a paragraph then it is
            block level</desc>
        </model>
      </elementSpec>
    </egXML>
  </exemplum>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-qy">
      <model predicate="parent::person" behaviour="inline">
        <desc versionDate="2015-08-21" xml:lang="en">If it is a child of a person element, treat as
          inline</desc>
      </model>
    </egXML>
  </exemplum>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-ws">
      <model behaviour="inline">
        <outputRendition>font-weight:bold</outputRendition>
      </model>
    </egXML>
  </exemplum>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-vj" source="#UND">
      <model behaviour="inline" output="print"/>
    </egXML>
  </exemplum>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-xb" source="#UND">
      <model predicate="ancestor::p" behaviour="inline">
        <param name="content" value="@n"/>
      </model>
    </egXML>
  </exemplum>
  <!-- <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples">
      <model predicate="parent::choice and count(parent::*/*) gt 1" behaviour="omit"/>
    </egXML>
  </exemplum>-->
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-sh" source="#UND">
      <elementSpec mode="change" ident="date">
        <model output="print" predicate="text()" behaviour="inline"/>
        <model output="print" predicate="@when and not(text())" behaviour="inline">
          <param name="content" value="@when"/>
        </model>
        <model predicate="@when" output="web" behaviour="alternate">
          <param name="alternate" value="@when"/>
        </model>
      </elementSpec>
    </egXML>
  </exemplum>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-model-egXML-er" source="#UND">
      <elementSpec mode="change" ident="choice">
        <model predicate="sic and corr" behaviour="alternate">
          <param name="default" value="corr"/>
          <param name="alternate" value="sic"/>
        </model>
        <model predicate="abbr and expan" behaviour="alternate">
          <param name="default" value="expan"/>
          <param name="alternate" value="abbr"/>
        </model>
        <model predicate="orig and reg" behaviour="alternate">
          <param name="default" value="reg"/>
          <param name="alternate" value="orig"/>
        </model>
      </elementSpec>
    </egXML>
  </exemplum>
  <remarks versionDate="2015-08-21" xml:lang="en">
    <p>The intended output to be generated for a particular behaviour of a processing model may be
      documented in one or all of the three following ways. Firstly, the <att>cssClass</att>
      attribute may be used to specify the name of a CSS style in some associated CSS stylesheet
      which is to be applied to each occurrence of a specified element found (in a given context,
      for a specified output). Secondly, the attribute <att>useSourceRendition</att> may be used to
      indicate that the default rendition for occurrences of this element, as defined by a
        <gi>rendition</gi> element in the document header, should be applied. Thirdly, the styling
      to be applied may be specified explicitly as content of a child <gi>outputRendition</gi>
      element. When more than one of these options is used, they are understood to be combined in
      accordance with the rules for multiple declaration of the styling language used.</p>
  </remarks>
  <listRef>
    <ptr target="#TDPMPM"/>
  </listRef>
</elementSpec>
