<model>

<model> describes the processing intended for a specified element. [22.5.4.1 The TEI processing model]
組件tagdocs — Documentation Elements
屬性att.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)) att.predicate (@predicate)
behaviournames the process or function which this processing model uses in order to produce output.
狀態 必備的
資料類型 teidata.enumerated
被推薦的值包含:
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
useSourceRenditionwhether to obey any rendition attribute that is present.
狀態 非必備的
資料類型 teidata.truthValue
outputthe intended output.
狀態 非必備的
資料類型 teidata.enumerated
實例值包含:
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
cssClassthe name of a CSS class which should be associated with this element
狀態 非必備的
資料類型 1–∞ 次可出現: teidata.name 以空白鍵隔開
可包含在於
可包含

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.

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

 <param name="contentvalue="@n"/>
</model>
例子
<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>
例子
<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>
宣告
<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:ref name="att.predicate.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="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,
   att.predicate.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 useSourceRendition { teidata.truthValue }?,
   attribute output { teidata.enumerated }?,
   attribute cssClass { list { teidata.name+ } }?,
   ( ( model.glossLike | model.descLike )*, param*, outputRendition* )
}