<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
Module tagdocsTD-datatypes
Attributes
Global and inherited attributes:
- @restrictionsupplies a string representing a regular expression providing additional constraints on the strings used to represent values of this datatype
- Status
- Datatype
- teidata.pattern
Classes and content
- Member of
- May contain
tagdocs
- Contained by
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.
Examples
<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>
Schematron
<constraintSpec xmlns:sch="http://purl.oclc.org/dsdl/schematron" ident="restrictDataFacet" scheme="schematron" xml:lang="en">
<constraint>
<sch:rule context="tei:dataRef[tei:dataFacet]">
<sch:assert test="@name" role="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> child element is present.</sch:report>
</sch:rule>
</constraint>
</constraintSpec><constraintSpec xmlns:sch="http://purl.oclc.org/dsdl/schematron" ident="restrictAttResctrictionName" scheme="schematron" xml:lang="en">
<constraint>
<sch:rule context="tei:dataRef[@restriction]">
<sch:assert test="@name" role="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>
</constraint>
</constraintSpec>Content model
<content>
<elementRef minOccurs="0" maxOccurs="unbounded" key="dataFacet"/>
</content>