<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema elementFormDefault="qualified"
           targetNamespace="http://www.xmlmind.com/xmleditor/schema/imagedemo"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:svg="http://www.w3.org/2000/svg"
           xmlns:imgd="http://www.xmlmind.com/xmleditor/schema/imagedemo"
           xmlns:html="http://www.w3.org/1999/xhtml">

  <xs:element name="imagedemo">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="heading" type="imgd:Heading"/>

        <xs:element name="para" type="imgd:StyledText"/>

        <xs:element name="item" type="imgd:Item"/>

        <xs:element name="image_au" type="imgd:Image_au"/>

        <xs:element name="image_eu" type="imgd:Image_eu"/>

        <xs:element name="image_ab" type="imgd:Image_ab"/>

        <xs:element name="image_eb" type="imgd:Image_eb"/>

        <xs:any namespace="http://www.w3.org/2000/svg"
                processContents="skip"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:complexType mixed="true" name="Heading"/>

  <xs:complexType mixed="true" name="StyledText">
    <xs:choice maxOccurs="unbounded" minOccurs="0">
      <xs:element name="bold" type="imgd:StyledText"/>

      <xs:element name="italic" type="imgd:StyledText"/>

      <xs:element name="tt" type="imgd:StyledText"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType mixed="true" name="Item">
    <xs:choice maxOccurs="unbounded" minOccurs="0">
      <xs:element name="bold" type="imgd:StyledText"/>

      <xs:element name="italic" type="imgd:StyledText"/>

      <xs:element name="tt" type="imgd:StyledText"/>

      <xs:element name="para" type="imgd:StyledText"/>

      <xs:element name="item" type="imgd:Item"/>
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="Image_au">
    <xs:attributeGroup ref="imgd:ImageAttributes"/>

    <xs:attribute name="location" type="xs:anyURI" use="required"/>
  </xs:complexType>

  <xs:complexType name="Image_eu">
    <xs:simpleContent>
      <xs:extension base="xs:anyURI">
        <xs:attributeGroup ref="imgd:ImageAttributes"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="Image_ab">
    <xs:attributeGroup ref="imgd:ImageAttributes"/>

    <xs:attribute name="data" type="xs:base64Binary" use="required"/>
  </xs:complexType>

  <xs:complexType name="Image_eb">
    <xs:simpleContent>
      <xs:extension base="xs:base64Binary">
        <xs:attributeGroup ref="imgd:ImageAttributes"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:attributeGroup name="ImageAttributes">
    <xs:attribute name="width" type="imgd:ImageSize"/>

    <xs:attribute name="height" type="imgd:ImageSize"/>

    <xs:attribute name="content_width" type="imgd:ImageContentSize"/>

    <xs:attribute name="content_height" type="imgd:ImageContentSize"/>

    <xs:attribute default="true" name="preserve_aspect_ratio"
                  type="xs:boolean"/>

    <xs:attribute default="center" name="anchor">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="center"/>

          <xs:enumeration value="north"/>

          <xs:enumeration value="east"/>

          <xs:enumeration value="south"/>

          <xs:enumeration value="west"/>

          <xs:enumeration value="north_west"/>

          <xs:enumeration value="north_east"/>

          <xs:enumeration value="south_east"/>

          <xs:enumeration value="south_west"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:simpleType name="ImageSize">
    <xs:restriction base="xs:string">
      <xs:pattern value="(\d+|\d*\.\d+)(in|cm|mm|pt|pc|em|ex|px|%)?"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ImageContentSize">
    <xs:union memberTypes="imgd:ImageSize">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="scale_to_fit"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
</xs:schema>