<?xml version="1.0" encoding="UTF-8"?>
<!-- © TEI Consortium. Dual-licensed under CC-by and BSD2 licenses; see the file COPYING.txt for details. -->
<?xml-model href="https://jenkins.tei-c.org/job/TEIP5-dev/lastSuccessfulBuild/artifact/P5/release/xml/tei/odd/p5.nvdl" type="application/xml" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?>
<elementSpec xmlns="http://www.tei-c.org/ns/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron" module="header" xml:id="gi-citeStructure" ident="citeStructure">
  <gloss versionDate="2020-02-03" xml:lang="en">citation structure</gloss>
  <desc versionDate="2020-02-03" xml:lang="en">declares a structure and method for citing the current document.</desc>
  <classes>
    <memberOf key="att.global"/>
    <memberOf key="att.citeStructurePart"/>
  </classes>
  <content>
    <sequence>
      <elementRef key="citeData" minOccurs="0" maxOccurs="unbounded"/>
      <elementRef key="citeStructure" minOccurs="0" maxOccurs="unbounded"/>
      <classRef key="model.descLike" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </content>
  <attList>
    <attDef ident="delim" usage="opt">
      <gloss versionDate="2020-02-03" xml:lang="en">delimiter</gloss>
      <desc versionDate="2020-02-03" xml:lang="en">supplies a delimiting string preceding the structural component.</desc>
      <datatype>
        <dataRef name="string" restriction=".+"/>
      </datatype>
      <remarks versionDate="2020-03-24" xml:lang="en">
        <p><att>delim</att> must contain at least one character.</p>
      </remarks>
    </attDef>
    <attDef ident="match" usage="req">
      <gloss versionDate="2020-02-03" xml:lang="en">match</gloss>
      <desc versionDate="2020-02-03" xml:lang="en">supplies an XPath selection pattern using the
        syntax defined in <ptr target="#XSLT3"/> which identifies a set of nodes which are 
        citable structural components. The expression may be absolute (beginning with <code>/</code>) or relative. 
        <att>match</att> on a <gi>citeStructure</gi> without a <gi>citeStructure</gi> parent must be an absolute XPath. If it is
        relative, its context is set by the <att>match</att> of the parent <gi>citeStructure</gi>.</desc>
      <datatype>
        <dataRef key="teidata.xpath"/>
      </datatype>
      <constraintSpec ident="citestructure-outer-match" scheme="schematron" xml:lang="en">
        <constraint>
          <sch:rule context="tei:citeStructure[not(parent::tei:citeStructure)]">
            <sch:assert test="starts-with(@match,'/')">An XPath in @match on the outer <sch:name/> must start with '/'.</sch:assert>
          </sch:rule>
        </constraint>
      </constraintSpec>
      <constraintSpec ident="citestructure-inner-match" scheme="schematron" xml:lang="en">
        <constraint>
          <sch:rule context="tei:citeStructure[parent::tei:citeStructure]">
            <sch:assert test="not(starts-with(@match,'/'))">An XPath in @match must not start with '/' except on the outer <sch:name/>.</sch:assert>
          </sch:rule>
        </constraint>
      </constraintSpec>
    </attDef>
    <attDef ident="unit" usage="opt">
      <gloss versionDate="2020-02-03" xml:lang="en">unit</gloss>
      <desc versionDate="2020-02-03" xml:lang="en">describes the structural unit indicated by the <gi>citeStructure</gi>.</desc>
      <datatype>
        <dataRef key="teidata.enumerated"/>
      </datatype>
      <valList type="open">
        <valItem ident="book"/>
        <valItem ident="chapter"/>
        <valItem ident="entry"/>
        <valItem ident="poem"/>
        <valItem ident="letter"/>
        <valItem ident="line"/>
        <valItem ident="section"/>
        <valItem ident="verse"/>
        <valItem ident="volume"/>
      </valList>
    </attDef>
  </attList>
  <exemplum xml:lang="en">
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-citeStructure-egXML-ch" source="#UND">
      <citeStructure unit="book" match="//body/div" use="@n">
        <citeStructure unit="chapter" match="div" use="position()" delim=" ">
          <citeStructure unit="verse" match="div" use="position()" delim=":"/>
        </citeStructure>
      </citeStructure>
    </egXML>
  </exemplum>
  <listRef>
    <ptr target="#CORS6"/>
    <ptr target="#SACRCS"/>
  </listRef>
</elementSpec>
