<?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" ident="rt" xml:id="gi-rt" module="core">
  <gloss versionDate="2021-01-30" xml:lang="en">ruby text</gloss>
  <gloss versionDate="2021-01-31" xml:lang="ja">ルビのテキスト。</gloss>
  <desc versionDate="2020-02-28" xml:lang="en">contains a ruby
    text, an annotation closely associated with a passage of the
    main text.</desc>
  <desc versionDate="2021-01-31" xml:lang="ja">本文の一部と密接な関連を持つ注釈（主に読み方）としてのルビテキストを含む。</desc>
  <classes>
    <memberOf key="att.global"/>
    <memberOf key="att.transcriptional"/>
    <memberOf key="att.typed"/>
  </classes>
  <content>
      <macroRef key="macro.phraseSeq"/>
  </content>
  <attList>
    <attDef ident="target" usage="opt">
      <desc versionDate="2021-01-08" xml:lang="en">supplies a pointer to the
        base being glossed by this ruby text.</desc>
      <desc versionDate="2021-01-31" xml:lang="ja">ルビテキストの対象へのポインタを示す。</desc>
      <datatype><dataRef key="teidata.pointer"/></datatype>
      <constraintSpec scheme="schematron" ident="rt-target-not-span" xml:lang="en">
        <!-- Note: this constraint should not be necessary, as the
             desired semantics should be something we could describe
             in PureODD using attList/@org. But I don’t think we
             can. —Syd -->
        <desc>Enforce that <emph>either</emph>
          <att>target</att> or both <att>from</att> and
          <att>to</att> (or none) are used, but not
          <att>target</att> in combination with either
          <att>from</att> or <att>to</att>.</desc>
        <constraint>
          <sch:rule context="tei:rt/@target">
            <sch:report test="../@from | ../@to">When target= is present, neither from= nor to= should be.</sch:report>
          </sch:rule>
        </constraint>
      </constraintSpec>
      <remarks versionDate="2020-02-01" xml:lang="en">
        <p>Should point to a single <gi>rb</gi> or an element
          that is inside an <gi>rb</gi>. To refer to multiple
          elements or text nodes at once use <att>from</att> and
          <att>to</att>.</p>
      </remarks>
    </attDef>
    <attDef ident="from" usage="opt">
      <desc versionDate="2021-01-06" xml:lang="en">points to the starting point of the span of text
        being glossed by this ruby text.</desc>
      <desc versionDate="2021-01-31" xml:lang="ja">ルビテキストの対象範囲の始点を示す。</desc>
      <datatype>
        <dataRef key="teidata.pointer"/>
      </datatype>
      <constraintSpec scheme="schematron" ident="rt-from" xml:lang="en">
        <!-- Note: this constraint should not be necessary, as the
             desired semantics should be something we could describe
             in PureODD using attList/@org. But I don’t think we
             can. —Syd -->
        <desc>Enforce the presence of <att>to</att> iff there
          is a <att>from</att>.</desc>
        <constraint>
          <sch:rule context="tei:rt/@from">
            <sch:assert test="../@to">When from= is present, the to= attribute of <sch:name/> is required.</sch:assert>
          </sch:rule>
        </constraint>
      </constraintSpec>
    </attDef>
    <attDef ident="to" usage="opt">
      <desc versionDate="2021-01-06" xml:lang="en">points to the ending point of the span of text
        being glossed.</desc>
      <desc versionDate="2021-01-31" xml:lang="ja">ルビテキストの対象範囲の終点を示す。</desc>
      <datatype>
        <dataRef key="teidata.pointer"/>
      </datatype>
      <constraintSpec scheme="schematron" ident="rt-to" xml:lang="en">
        <!-- Note: this constraint should not be necessary, as the
             desired semantics should be something we could describe
             in PureODD using attList/@org. But I don’t think we
             can. —Syd -->
        <desc>Enforce the presence of <att>from</att> iff there
          is a <att>to</att>.</desc>
        <constraint>
          <sch:rule context="tei:rt/@to">
            <sch:assert test="../@from">When to= is present, the from= attribute of <sch:name/> is required.</sch:assert>
          </sch:rule>
        </constraint>
      </constraintSpec>
    </attDef>
  </attList>
  <!-- More examples to be added. -->
  <exemplum versionDate="2021-02-01" xml:lang="mul">
    <p>The word <mentioned>大統領</mentioned> <mentioned>daitōryō</mentioned>
      (president) is glossed character by character in hiragana to provide a pronunciation guide.</p>
    <egXML xmlns="http://www.tei-c.org/ns/Examples" xml:id="gi-rt-egXML-py">
      <p style="writing-mode: vertical-rl" xml:lang="ja"> 
        <!--...-->
        <ruby><rb>大</rb><rt place="right">だい</rt></ruby>
        <ruby><rb>統</rb><rt place="right">とう</rt></ruby>
        <ruby><rb>領</rb><rt place="right">りょう</rt></ruby>
        <!--...-->
      </p>
    </egXML>
  </exemplum>
  <remarks versionDate="2021-02-02" xml:lang="en">
    <p>Where the <att>place</att> attribute is not provided on the <gi>rt</gi>
      element, the default assumption is that the 
      ruby gloss is <val>above</val> where the text is horizontal, and to the
      <val>right</val> of the text where it is vertical. </p>
  </remarks>
  <listRef>
    <ptr target="#COHTGRB"/>
  </listRef>
</elementSpec>
