<dataRef>

<dataRef> identifies the datatype of an attribute value, either by referencing an item in an externally defined datatype library, or by pointing to a TEI-defined data specification [22.5.3.1 Datatypes]
組件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))
keythe identifier used for this datatype specification
狀態 非必備的
資料類型 teidata.xmlName
namethe name of a datatype in the list provided by XML Schemas: Part 2: Datatypes
狀態 非必備的
資料類型 teidata.xmlName
refa pointer to a datatype defined in some datatype library
狀態 非必備的
資料類型 teidata.pointer
restrictionsupplies a string representing a regular expression providing additional constraints on the strings used to represent values of this datatype
狀態 非必備的
資料類型 teidata.pattern
俱乐部会员
可包含在於
可包含
tagdocs: dataFacet

Only one of the attributes key, name, and ref may be used.

dataFacet children are only allowed when dataRef refers with name to a datatype from the specification XML Schemas: Part 2: Datatypes.

restriction is only permitted when dataRef uses the name attribute.

例子
<schemaSpec ident="myTEI"
 source="http://www.tei-c.org/Vault/P5/current/xml/tei/odd/p5subset.xml">

<!-- ... -->
 <dataRef key="teidata.enumerated"/>
<!-- ... -->
</schemaSpec>
例子
<schemaSpec ident="myTEI"
 source="http://www.tei-c.org/Vault/P5/current/xml/tei/odd/p5subset.xml">

<!-- ... -->
 <dataRef name="float"/>
<!-- ... -->
</schemaSpec>
例子
<dataSpec ident="data.integerExample">
 <desc>datatype used for attributes taking an integer value between 0 and 99</desc>
 <content>
  <dataRef name="nonNegativeInteger"
   restriction="[0-9][0-9]?"/>

 </content>
</dataSpec>
Schematron

<sch:rule context="tei:dataRef[tei:dataFacet]">
<sch:assert test="@namerole="nonfatal">Data facets can only be specified for references to datatypes specified by
XML Schemas: Part 2: Datatypes</sch:assert>
</sch:rule>
Schematron

<sch:rule context="tei:dataRef[tei:dataFacet]">
<sch:report test="@restriction"
 role="nonfatal">
The attribute restriction cannot be used when dataFacet elements are present.</sch:report>
</sch:rule>
Schematron

<sch:rule context="tei:dataRef">
<sch:report test="@restriction and not(@name)"
 role="fatal">
The attribute restriction can only be used with a name attribute.</sch:report>
</sch:rule>
Content model
<content>
 <elementRef minOccurs="0"
  maxOccurs="unboundedkey="dataFacet"/>

</content>
宣告
<rng:element name="dataRef">
 <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:choice>
  <rng:optional>
   <rng:attribute name="key">
    <rng:ref name="teidata.xmlName"/>
   </rng:attribute>
  </rng:optional>
  <rng:optional>
   <rng:attribute name="name">
    <rng:ref name="teidata.xmlName"/>
   </rng:attribute>
  </rng:optional>
  <rng:optional>
   <rng:attribute name="ref">
    <rng:ref name="teidata.pointer"/>
   </rng:attribute>
  </rng:optional>
 </rng:choice>
 <rng:optional>
  <rng:attribute name="restriction">
   <rng:ref name="teidata.pattern"/>
  </rng:attribute>
 </rng:optional>
 <rng:zeroOrMore>
  <rng:ref name="dataFacet"/>
 </rng:zeroOrMore>
</rng:element>
element dataRef
{
   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 key { teidata.xmlName }?
    | attribute name { teidata.xmlName }?
    | attribute ref { teidata.pointer }?
   ),
   attribute restriction { teidata.pattern }?,
   dataFacet*
}