<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]
Module tagdocs — Documentation Elements
Attributes
key⚓︎ the identifier used for this datatype specification
Status Optional
Datatype teidata.xmlName
name⚓︎ the name of a datatype in the list provided by XML Schema Part 2: Datatypes Second Edition
Status Optional
Datatype teidata.xmlName
ref⚓︎ a pointer to a datatype defined in some datatype library
Status Optional
Datatype teidata.pointer
restriction⚓︎ supplies a string representing a regular expression providing additional constraints on the strings used to represent values of this datatype
Status Optional
Datatype teidata.pattern
Member of
Contained by
May contain
tagdocs: dataFacet
Note

Only one of the attributes key, name, and ref may be used on any given instance of dataRef.

Neither a restriction attribute nor a dataFacet child element may be used unless the dataRef refers to a datatype from the specification XML Schema Part 2: Datatypes Second Edition with a name attribute.

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

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

<!-- ... -->
 <dataRef name="float"/>
<!-- ... -->
</schemaSpec>
Example
<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 Schema Part 2: Datatypes Second Edition — that is, for there to be a 'dataFacet' child there must be a @name attribute.</sch:assert>
<sch:report test="@restriction"
 role="nonfatal">
Data facets and restrictions cannot both be expressed on the same data reference — that is, the @restriction attribute cannot be used when a 'dataFacet' element is present.</sch:report>
</sch:rule>
Schematron

<sch:rule context="tei:dataRef[@restriction]">
<sch:assert test="@namerole="nonfatal">Restrictions can only be specified for references to datatypes specified by
XML Schema Part 2: Datatypes Second Edition — that is, for there to be a @restriction attribute there must be a @name attribute, too.</sch:assert>
</sch:rule>
Content model
<content>
 <elementRef minOccurs="0"
  maxOccurs="unboundedkey="dataFacet"/>

</content>
Schema Declaration
<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*
}