<moduleRef>

<moduleRef> (module reference) references a module which is to be incorporated into a schema. [22.2 Modules and Schemas]
Moduletagdocs — Documentation Elements
Attributesatt.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))
prefixspecifies a default prefix which will be prepended to all patterns from the imported module
Status Optional
Datatype 0–1 occurrences of teidata.xmlName separated by whitespace
Schematron

<s:rule context="tei:moduleRef">
<s:report test="//*[ not( generate-id(.) eq generate-id( current() ) ) ]/@prefix = @prefix">The prefix attribute
of <s:name/> should not match that of any other
element (it would defeat the purpose)</s:report>
</s:rule>
Note

Use of this attribute avoids name collisions (and thus invalid schemas) when the external schema being mixed in with TEI uses a name the TEI or some other included external schema already uses for a pattern.

includesupplies a list of the elements which are to be copied from the specified module into the schema being defined.
Status Optional
Datatype 0–∞ occurrences of teidata.xmlName separated by whitespace
exceptsupplies a list of the elements which are not to be copied from the specified module into the schema being defined.
Status Optional
Datatype 0–∞ occurrences of teidata.xmlName separated by whitespace
keythe name of a TEI module
Status Optional
Datatype teidata.xmlName
url(uniform resource locator) refers to a non-TEI module of RELAX NG code by external location
Status Optional
Datatype teidata.pointer
Member of
Contained by
May contain
tagdocs: content
Note

If neither include nor exclude is supplied, the effect of this element is to make all the declarations contained by the referenced module available to the schema being compiled. If both attributes are supplied, an ODD processor should signal an error.

A TEI module is identified by the name supplied as value for the ident attribute on a moduleSpec element. The source attribute may be used to specify an online source from which the specification of that module may be read. A URI may alternatively be supplied in the case of a non-TEI module, and this is expected to be written as a RELAX NG schema.

If the uri attribute is used, the content element may also be supplied as a child of this element. Its content (which is assumed to be a fragment of RELAX NG code) will be copied along with the content of the resource indicated by the uri attribute into the target RELAX NG schema.

Example
<moduleRef key="linking"/>

This includes all objects available from the linking module.

Example
<moduleRef key="linking"
 except="linkGrp link"/>

This includes all elements available from the linking module except for the link and linkGrp elements.

Example
<moduleRef key="linking"
 include="linkGrp link"/>

This includes only the link and linkGrp elements from the linking module.

Schematron

<s:rule context="tei:moduleRef">
<s:report test="* and @key">Child elements of <s:name/> are only allowed when an external module is being loaded
</s:report>
</s:rule>
Content model
<content>
 <elementRef key="contentminOccurs="0"/>
</content>
Schema Declaration
<rng:element name="moduleRef">
 <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:optional>
  <rng:attribute name="prefix">
   <rng:ref name="teidata.xmlName"/>
  </rng:attribute>
 </rng:optional>
 <xhtml:tr>
  <xhtml:td>[#not-same-prefix]</xhtml:td>
  <xhtml:td>
   <xhtml:div id="index-egXML-d563097e1"
    class="pre egXML_valid">

    <xhtml:span class="element"><constraint></xhtml:span>
    <xhtml:br/>
    <xhtml:span class="element"><s:rule <xhtml:span class="attribute">context</xhtml:span>="<xhtml:span class="attributevalue">tei:moduleRef</xhtml:span>"></xhtml:span>
    <xhtml:br/> <xhtml:span class="element"><s:report <xhtml:span class="attribute">test</xhtml:span>="<xhtml:span class="attributevalue">//*[ not( generate-id(.) eq generate-id( current() ) ) ]/@prefix =
           @prefix</xhtml:span>"></xhtml:span>The prefix attribute<xhtml:br/>   of <xhtml:span class="element"><s:name/></xhtml:span> should not match that of any other<xhtml:br/>   element (it would defeat the purpose)<xhtml:span class="element"></s:report></xhtml:span>
    <xhtml:br/>
    <xhtml:span class="element"></s:rule></xhtml:span>
    <xhtml:br/>
    <xhtml:span class="element"></constraint></xhtml:span>
   </xhtml:div>
  </xhtml:td>
 </xhtml:tr>
 <rng:choice>
  <rng:optional>
   <rng:attribute name="include">
    <rng:list>
     <rng:zeroOrMore>
      <rng:ref name="teidata.xmlName"/>
     </rng:zeroOrMore>
    </rng:list>
   </rng:attribute>
  </rng:optional>
  <rng:optional>
   <rng:attribute name="except">
    <rng:list>
     <rng:zeroOrMore>
      <rng:ref name="teidata.xmlName"/>
     </rng:zeroOrMore>
    </rng:list>
   </rng:attribute>
  </rng:optional>
 </rng:choice>
 <rng:choice>
  <rng:optional>
   <rng:attribute name="key">
    <rng:ref name="teidata.xmlName"/>
   </rng:attribute>
  </rng:optional>
  <rng:optional>
   <rng:attribute name="url">
    <rng:ref name="teidata.pointer"/>
   </rng:attribute>
  </rng:optional>
 </rng:choice>
 <rng:optional>
  <rng:ref name="content"/>
 </rng:optional>
</rng:element>
element moduleRef
{
   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 prefix { teidata.xmlName }?
   >>
   d563094e16:tr
   [
      "[#not-same-prefix]"
      "<constraint>"
      "<s:rule "
      "context"
      """=""""
      "tei:moduleRef"
      """">"""
      " "
      "<s:report "
      "test"
      """=""""
      """//*[ not( generate-id(.) eq generate-id( current() ) ) ]/@prefix = 
 @prefix"""
      """">"""
      "The prefix attribute"
      "   of "
      "<s:name/>"
      " should not match that of any other"
      "   element (it would defeat the purpose)"
      "</s:report>"
      "</s:rule>"
      "</constraint>"
   ],
   (
      attribute include { list { teidata.xmlName* } }?
    | attribute except { list { teidata.xmlName* } }?
   ),
   ( attribute key { teidata.xmlName }? | attribute url { teidata.pointer }? ),
   content?
}