Skip to content

<model>

describes the processing intended for a specified element.

Module tagdocsTDPMPM

Attributes

@behaviournames the process or function which this processing model uses in order to produce output.
Status
Required
Datatype
teidata.enumerated
Suggested values
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
create an identifiable anchor point in the output.
block
create a block structure
body
create the body of a document.
break
create a line, column, or page break according to the value of type
cell
create a table cell
cit
show the content, with an indication of the source
document
start a new output document
figure
make a figure with the title as caption
glyph
show a character by looking up reference to a chardesc at the given URI
graphic
if url is present, uses it to display graphic, else display a placeholder image.
heading
creates a heading.
index
generate list according to type.
inline
creates inline element out of content
link
create hyperlink
list
create a list.
listItem
create a list item.
metadata
create metadata section
note
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
create a paragraph out of content.
row
create a table row
section
create a new section of the output document
table
create a table
text
create literal text
title
create document title
@useSourceRenditionwhether to obey any rendition attribute that is present.
Status
Optional
Datatype
teidata.truthValue
@outputthe intended output.
Status
Optional
Datatype
teidata.enumerated
Sample values
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
Status
Optional
Datatype
1–∞ occurrences of teidata.name separated by whitespace

Classes and content

May contain
Contained by

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.

Examples

<model behaviour="inline"/>
<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>
<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="inline" output="print"/>
<model predicate="ancestor::p" behaviour="inline">
  <param name="content" value="@n"/>
</model>
<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>
<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>

Schematron

<constraintSpec xmlns:sch="http://purl.oclc.org/dsdl/schematron" 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>
    
    <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) &lt;model&gt; elements in this
          &lt;<sch:value-of select="local-name(..)"/>&gt; 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 xmlns:sch="http://purl.oclc.org/dsdl/schematron" 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) &lt;model&gt; elements in this
          &lt;<sch:value-of select="local-name(..)"/>&gt; 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>

Content model

<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>