<!-- ==============================================================
      SVG12-RNG | Images
     ============================================================== -->

<grammar ns='http://www.w3.org/2000/svg'
         xml:lang='en'
         xmlns='http://relaxng.org/ns/structure/1.0'
         xmlns:a='http://relaxng.org/ns/compatibility/annotations/1.0'
         datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'
         >


  <define name='SVG.Image.class' combine='choice'>
    <choice>
      <ref name='image'/>
    </choice>
  </define>




  <define name='SVG.image.content'>
    <zeroOrMore>
      <ref name='SVG.Description.class'/>
    </zeroOrMore>
    <zeroOrMore>
      <choice>
        <ref name='SVG.Animation.class'/>
        <ref name='SVG.Handler.class'/>
      </choice>
    </zeroOrMore>
  </define>

  <define name='image'>
    <element name='image'>
      <ref name='attlist.image'/>
      <ref name='SVG.image.content'/>
    </element>
  </define>

  <define name='attlist.image' combine='interleave'>
    <ref name='SVG.Core.attrib'/>
    <ref name='SVG.Conditional.attrib'/>
    <ref name='SVG.Style.attrib'/>
    <ref name='SVG.Viewport.attrib'/>
    <ref name='SVG.Color.attrib'/>
    <ref name='SVG.Opacity.attrib'/>
    <ref name='SVG.Graphics.attrib'/>
    <ref name='SVG.Focusable.attrib'/>
    <ref name='SVG.Profile.attrib'/>
    <ref name='SVG.Clip.attrib'/>
    <ref name='SVG.Mask.attrib'/>
    <ref name='SVG.Filter.attrib'/>
    <ref name='SVG.GraphicalEvents.attrib'/>
    <ref name='SVG.Cursor.attrib'/>
    <ref name='SVG.XLinkEmbed.attrib'/>
    <ref name='SVG.External.attrib'/>
    <ref name='SVG.Transition.attrib'/>
    <ref name='SVG.BackgroundFill.attrib'/>
    <optional>
      <attribute name='x'>
        <ref name='Coordinate.datatype'/>
      </attribute>
    </optional>
    <optional>
      <attribute name='y'>
        <ref name='Coordinate.datatype'/>
      </attribute>
    </optional>
    <attribute name='width'>
      <ref name='Length.datatype'/>
    </attribute>
    <attribute name='height'>
      <ref name='Length.datatype'/>
    </attribute>
    <optional>
      <attribute name='preserveAspectRatio' a:defaultValue='xMidYMid meet'>
        <ref name='PreserveAspectRatioSpec.datatype'/>
      </attribute>
    </optional>
    <ref name='SVG.transform.attrib'/>
  </define>

</grammar>
