<module relaxCoreVersion="1.0"
  xmlns="http://www.xml.gr.jp/xmlns/relaxCore"
  moduleVersion="$Id: xhtml-ruby-1.rxm,v 1.1 2001/05/30 00:29:58 mimasa Exp $"
  targetNamespace="http://www.w3.org/1999/xhtml">

  <annotation>
    <documentation>
      XHTML Ruby Module in RELAX

        Ruby Elements

          ruby, rbc, rtc, rb, rt, rp

      This module defines grammars to support ruby annotation markup.
      This module is based on the W3C Ruby Annotation Specification:

        http://www.w3.org/TR/ruby
    </documentation>
  </annotation>

  <div>
    <annotation>
      <documentation>
        hedgeRules for the content model of the ruby element
      </documentation>
    </annotation>

    <hedgeRule label="Ruby.content.simple">
      <annotation>
        <documentation>Content model of simple ruby</documentation>
      </annotation>

      <sequence>
        <ref label="rb"/>
        <choice>
          <ref label="rt-simple"/>
          <sequence>
            <ref label="rp"/>
            <ref label="rt-simple"/>
            <ref label="rp"/>
          </sequence>
        </choice>
      </sequence>
    </hedgeRule>

    <hedgeRule label="Ruby.content.complex">
      <annotation>
        <documentation>Content model of complex ruby</documentation>
      </annotation>

      <sequence>
        <ref label="rbc"/>
        <ref label="rtc"/>
        <ref label="rtc" occurs="?"/>
      </sequence>
    </hedgeRule>

    <hedgeRule label="Ruby.content">
      <annotation>
        <documentation>Simple ruby is used by default</documentation>
      </annotation>

      <hedgeRef label="Ruby.content.simple"/>
    </hedgeRule>
  </div>

  <div>
    <annotation>
      <documentation>ruby element</documentation>
    </annotation>

    <elementRule role="ruby">
      <hedgeRef label="Ruby.content"/>
    </elementRule>

    <tag name="ruby">
      <ref role="Ruby.common.attrib"/>
    </tag>
  </div>

  <div>
    <annotation>
      <documentation>rbc (ruby base component) element</documentation>
    </annotation>

    <elementRule role="rbc">
      <ref label="rb" occurs="+"/>
    </elementRule>

    <tag name="rbc">
      <ref role="Ruby.common.attrib"/>
    </tag>
  </div>

  <div>
    <annotation>
      <documentation>rtc (ruby text component) element</documentation>
    </annotation>

    <elementRule role="rtc">
      <ref label="rt-complex" occurs="+"/>
    </elementRule>

    <tag name="rtc">
      <ref role="Ruby.common.attrib"/>
    </tag>
  </div>

  <div>
    <annotation>
      <documentation>rb (ruby base) element</documentation>
    </annotation>

    <elementRule role="rb">
      <mixed>
        <hedgeRef label="NoRuby.content" occurs="*"/>
      </mixed>
    </elementRule>

    <tag name="rb">
      <ref role="Ruby.common.attrib"/>
    </tag>
  </div>

  <div>
    <annotation>
      <documentation>rt (ruby text) element</documentation>
    </annotation>

    <elementRule label="rt-simple">
      <annotation>
        <documentation>
          elementRule for simple ruby

          rbspan attribute is not allowed in simple ruby
        </documentation>
      </annotation>

      <tag name="rt">
        <ref role="Ruby.common.attrib"/>
        <attribute name="rbspan" type="none"/>
      </tag>

      <mixed>
        <hedgeRef label="NoRuby.content" occurs="*"/>
      </mixed>
    </elementRule>

    <elementRule label="rt-complex">
      <annotation>
        <documentation>
          elementRule for complex ruby
        </documentation>
      </annotation>

      <tag name="rt">
        <ref role="Ruby.common.attrib"/>
        <attribute name="rbspan" type="positiveInteger"/>
      </tag>

      <mixed>
        <hedgeRef label="NoRuby.content" occurs="*"/>
      </mixed>
    </elementRule>
  </div>

  <div>
    <annotation>
      <documentation>rp (ruby parenthesis) element</documentation>
    </annotation>

    <elementRule role="rp" type="string"/>

    <tag name="rp">
      <ref role="Ruby.common.attrib"/>
    </tag>
  </div>

  <div>
   <annotation>
      <documentation>
        Ruby Common Attributes

        Ruby elements are intended to have common attributes of its
        parent markup language. An attPool "Ruby.common.attrib" MUST
        be defined to integrate this module.
      </documentation>
    </annotation>
  </div>

  <hedgeRule label="NoRuby.content">
    <annotation>
      <documentation>
        Content models of the rb and the rt elements are intended to
        allow other inline-level elements of its parent markup language,
        but it should not include ruby descendent elements. The hedgeRule
        'NoRuby.content' can be used to redefine those content models.
        It's defined as 'empty' by default.
      </documentation>
    </annotation>

    <empty/>
  </hedgeRule>

</module>
