<model>

<model> describes the processing intended for a specified element. [22.5.5.1 The TEI processing model]
Moduletagdocs — Documentation Elements
Attributesatt.global (@xml:id, @n, @xml:lang, @xml:base, @xml:space) (att.global.rendition (@rend, @style, @rendition)) (att.global.linking (@corresp, @synch, @sameAs, @copyOf, @next, @prev, @exclude, @select)) (att.global.analytic (@ana)) (att.global.facs (@facs)) (att.global.change (@change)) (att.global.responsibility (@cert, @resp)) (att.global.source (@source))
behaviournames the process or function which this processing model uses in order to produce output. Suggested values include: 1] alternate; 2] anchor; 3] block; 4] body; 5] break; 6] cell; 7] cit; 8] document; 9] figure; 10] glyph; 11] graphic; 12] heading; 13] index; 14] inline; 15] link; 16] list; 17] listItem; 18] metadata; 19] note; 20] omit; 21] paragraph; 22] row; 23] section; 24] table; 25] text; 26] title
Status Required
Datatype teidata.enumerated
Suggested values include:
alternate
(default, alternate) support display of alternative visualisations, for example by displaying the preferred content, by displaying both in parallel, or by toggling between the two.
anchor
(id) create an identifiable anchor point in the output.
block
(content) create a block structure
body
(content) create the body of a document.
break
(type, label) create a line, column, or page break according to the value of type
cell
(content) create a table cell
cit
(content, source) show the content, with an indication of the source
document
(content) start a new output document
figure
(title) make a figure with the title as caption
glyph
(uri) show a character by looking up reference to a chardesc at the given URI
graphic
(url, width, height, scale, title) if url is present, uses it to display graphic, else display a placeholder image.
heading
(content, level) creates a heading.
index
(type) generate list according to type.
inline
(content, label) creates inline element out of content
link
(content, uri) create hyperlink
list
(content) create a list.
listItem
(content) create a list item.
metadata
(content) create metadata section
note
(content, place, label) create a note, often out of line, depending on the value of place; could be margin, footnote, endnote, inline
omit
do nothing, do not process children
paragraph
(content) create a paragraph out of content.
row
(content) create a table row
section
(content) create a new section of the output document
table
(content) create a table
text
(content) create literal text
title
(content) create document title
predicatethe condition under which this model applies, given as an XPath predicate expression.
Status Optional
Datatype teidata.xpath
useSourceRenditionwhether to obey any rendition attribute which is present.
Status Optional
Datatype teidata.truthValue
Note

If the useSourceRendition attribute is not specified, or has the value false, any renditional information specified in the source document should be ignored.

outputthe intended output. Sample values include: 1] web; 2] print; 3] plain
Status Optional
Datatype teidata.enumerated
Sample values include:
web
the output is intended for presentation in a web format
print
the output is intended for presentation in a print format
plain
the output is intended for presentation in a plain text format
Note

If the output attribute is not specified, this model is assumed to apply for all forms of output.

cssClassthe name of a CSS class which should be associated with this element
Status Optional
Datatype 1–∞ occurrences of teidata.name separated by whitespace
Contained by
May contain
Note

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 cssClass 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 useSourceRendition may be used to indicate that the default rendition for occurrences of this element, as defined by a rendition element in the document header, should be applied. Thirdly, the styling to be applied may be specified explicitly as content of a child outputRendition 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.

Example
<model behaviour="inline"/>
Example
<elementSpec mode="changeident="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>
Example
<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>
Example
<model behaviour="inline">
 <outputRendition>font-weight:bold</outputRendition>
</model>
Example
<model behaviour="inlineoutput="print"/>
Example
<model predicate="ancestor::p"
 behaviour="inline">

 <param name="contentvalue="@n"/>
</model>
Example
<elementSpec mode="changeident="date">
 <model output="printpredicate="text()"
  behaviour="inline"/>

 <model output="print"
  predicate="@when and not(text())behaviour="inline">

  <param name="contentvalue="@when"/>
 </model>
 <model predicate="@whenoutput="web"
  behaviour="alternate">

  <param name="alternatevalue="@when"/>
 </model>
</elementSpec>
Example
<elementSpec mode="changeident="choice">
 <model predicate="sic and corr"
  behaviour="alternate">

  <param name="defaultvalue="corr"/>
  <param name="alternatevalue="sic"/>
 </model>
 <model predicate="abbr and expan"
  behaviour="alternate">

  <param name="defaultvalue="expan"/>
  <param name="alternatevalue="abbr"/>
 </model>
 <model predicate="orig and reg"
  behaviour="alternate">

  <param name="defaultvalue="reg"/>
  <param name="alternatevalue="orig"/>
 </model>
</elementSpec>
SchematronIt is ambigous to have 2 models that have both the same output and have no predicate (and thus select the same set of nodes).

<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>
SchematronIt is ambigous to have 2 models that have both the same output and the same predicate (and thus select the same set of nodes).

<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>
Content model
<content>
 <sequence>
  <alternate minOccurs="0"
   maxOccurs="unbounded">

   <classRef key="model.glossLike"/>
   <classRef key="model.descLike"/>
  </alternate>
  <elementRef key="paramminOccurs="0"
   maxOccurs="unbounded"/>

  <elementRef key="outputRendition"
   minOccurs="0maxOccurs="unbounded"/>

 </sequence>
</content>
Schema Declaration
<rng:element name="model">
 <rng:ref name="att.global.attributes"/>
 <rng:ref name="att.global.rendition.attributes"/>
 <rng:ref name="att.global.linking.attributes"/>
 <rng:ref name="att.global.analytic.attributes"/>
 <rng:ref name="att.global.facs.attributes"/>
 <rng:ref name="att.global.change.attributes"/>
 <rng:ref name="att.global.responsibility.attributes"/>
 <rng:ref name="att.global.source.attributes"/>
 <rng:attribute name="behaviour">
  <rng:choice>
   <rng:value>alternate</rng:value>
   <rng:value>anchor</rng:value>
   <rng:value>block</rng:value>
   <rng:value>body</rng:value>
   <rng:value>break</rng:value>
   <rng:value>cell</rng:value>
   <rng:value>cit</rng:value>
   <rng:value>document</rng:value>
   <rng:value>figure</rng:value>
   <rng:value>glyph</rng:value>
   <rng:value>graphic</rng:value>
   <rng:value>heading</rng:value>
   <rng:value>index</rng:value>
   <rng:value>inline</rng:value>
   <rng:value>link</rng:value>
   <rng:value>list</rng:value>
   <rng:value>listItem</rng:value>
   <rng:value>metadata</rng:value>
   <rng:value>note</rng:value>
   <rng:value>omit</rng:value>
   <rng:value>paragraph</rng:value>
   <rng:value>row</rng:value>
   <rng:value>section</rng:value>
   <rng:value>table</rng:value>
   <rng:value>text</rng:value>
   <rng:value>title</rng:value>
   <rng:ref name="teidata.enumerated"/>
  </rng:choice>
 </rng:attribute>
 <rng:optional>
  <rng:attribute name="predicate">
   <rng:ref name="teidata.xpath"/>
  </rng:attribute>
 </rng:optional>
 <rng:optional>
  <rng:attribute name="useSourceRendition">
   <rng:ref name="teidata.truthValue"/>
  </rng:attribute>
 </rng:optional>
 <rng:optional>
  <rng:attribute name="output">
   <rng:ref name="teidata.enumerated"/>
  </rng:attribute>
 </rng:optional>
 <rng:optional>
  <rng:attribute name="cssClass">
   <rng:list>
    <rng:oneOrMore>
     <rng:ref name="teidata.name"/>
    </rng:oneOrMore>
   </rng:list>
  </rng:attribute>
 </rng:optional>
 <rng:group>
  <rng:zeroOrMore>
   <rng:choice>
    <rng:ref name="model.glossLike"/>
    <rng:ref name="model.descLike"/>
   </rng:choice>
  </rng:zeroOrMore>
  <rng:zeroOrMore>
   <rng:ref name="param"/>
  </rng:zeroOrMore>
  <rng:zeroOrMore>
   <rng:ref name="outputRendition"/>
  </rng:zeroOrMore>
 </rng:group>
</rng:element>
element model
{
   att.global.attributes,
   att.global.rendition.attributes,
   att.global.linking.attributes,
   att.global.analytic.attributes,
   att.global.facs.attributes,
   att.global.change.attributes,
   att.global.responsibility.attributes,
   att.global.source.attributes,
   attribute behaviour
   {
      "alternate"
    | "anchor"
    | "block"
    | "body"
    | "break"
    | "cell"
    | "cit"
    | "document"
    | "figure"
    | "glyph"
    | "graphic"
    | "heading"
    | "index"
    | "inline"
    | "link"
    | "list"
    | "listItem"
    | "metadata"
    | "note"
    | "omit"
    | "paragraph"
    | "row"
    | "section"
    | "table"
    | "text"
    | "title"
    | teidata.enumerated
   },
   attribute predicate { teidata.xpath }?,
   attribute useSourceRendition { teidata.truthValue }?,
   attribute output { teidata.enumerated }?,
   attribute cssClass { list { teidata.name+ } }?,
   ( ( model.glossLike | model.descLike )*, param*, outputRendition* )
}