<elementRef>
points to the specification for some element which is to be included in a schema.
Module tagdocsTDmodules
Attributes
Global and inherited attributes:
- @keythe identifier used for the required element within the source indicated.
- Status
- Required
- Datatype
- teidata.xmlName
Classes and content
- Member of
- May contain
- empty
- Contained by
Note
Elements are identified by the name supplied as value for the @ident attribute on the elementSpec element in which they are declared. TEI element names are unique.
Examples
<elementRef key="p"/>
Include in the schema an element named p available from the current default source.
<elementRef key="p" source="tei:1.2.1"/>
Include in the schema an element named p available from the TEI P5 1.2.1 release.
Schematron
<constraintSpec xmlns:sch="http://purl.oclc.org/dsdl/schematron" ident="only_sensible_attrs" scheme="schematron" xml:lang="en">
<constraint>
<sch:pattern>
<sch:rule context="tei:elementRef[ parent::tei:schemaSpec | parent::tei:specGrp ]">
<sch:report test="@minOccurs | @maxOccurs" role="error">An element reference is not repeatable when part of a schema specification (and thus this <elementRef> should not have @minOccurs or @maxOccurs).</sch:report>
</sch:rule>
<sch:rule context="tei:content//tei:elementRef">
<sch:report test="@source" role="error">An element reference within a content model must refer to a locally defined element specification (and thus this <elementRef> should not have @source).</sch:report>
</sch:rule>
</sch:pattern>
</constraint>
</constraintSpec>Content model
<content>
<empty/>
</content>