<alternate>

<alternate> indicates that the constructs referenced by its children form an alternation. [23.5.1 Defining Content Models]
組件 tagdocs — Documentation Elements
屬性
俱乐部会员
可包含在於
可包含
例子
<content>
 <alternate>
  <elementRef key="name"/>
  <elementRef key="persName"/>
 </alternate>
</content>

This example content model permits either a name or a persName.

Schematron

<sch:rule context="tei:alternate">
<sch:assert test="count(*) gt 1">The alternate element must have at least two child elements.</sch:assert>
</sch:rule>
Content model
<content>
 <alternate>
  <sequence>
   <elementRef key="valListminOccurs="1"
    maxOccurs="1"/>

   <classRef key="model.contentPart"
    minOccurs="0maxOccurs="unbounded"/>

  </sequence>
  <sequence>
   <classRef key="model.contentPart"
    minOccurs="1maxOccurs="unbounded"/>

   <elementRef key="valListminOccurs="0"
    maxOccurs="1"/>

  </sequence>
 </alternate>
</content>
宣告
<rng:element name="alternate">
 <rng:ref name="att.global.attributes"/>
 <rng:ref name="att.global.analytic.attributes"/>
 <rng:ref name="att.global.change.attributes"/>
 <rng:ref name="att.global.facs.attributes"/>
 <rng:ref name="att.global.linking.attributes"/>
 <rng:ref name="att.global.rendition.attributes"/>
 <rng:ref name="att.global.responsibility.attributes"/>
 <rng:ref name="att.global.source.attributes"/>
 <rng:ref name="att.repeatable.attributes"/>
 <rng:choice>
  <rng:group>
   <rng:ref name="valList"/>
   <rng:zeroOrMore>
    <rng:ref name="model.contentPart"/>
   </rng:zeroOrMore>
  </rng:group>
  <rng:group>
   <rng:oneOrMore>
    <rng:ref name="model.contentPart"/>
   </rng:oneOrMore>
   <rng:optional>
    <rng:ref name="valList"/>
   </rng:optional>
  </rng:group>
 </rng:choice>
</rng:element>
element alternate
{
   att.global.attributes,
   att.global.analytic.attributes,
   att.global.change.attributes,
   att.global.facs.attributes,
   att.global.linking.attributes,
   att.global.rendition.attributes,
   att.global.responsibility.attributes,
   att.global.source.attributes,
   att.repeatable.attributes,
   ( ( valList, model.contentPart* ) | ( model.contentPart+, valList? ) )
}