<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="body" type="bodyType">
<xs:annotation>
<xs:documentation>
This is an artificial element that is not part of the HTML format. It's here to allow us to define the
schema as XML does not support multiple root elements. In the future we may accept it on the input.
(If it would be useful for you, please let us know).
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="bodyType">
<xs:annotation>
<xs:documentation>Elements that can be used on the top level.</xs:documentation>
</xs:annotation>
<xs:choice maxOccurs="unbounded">
<xs:element name="h1" type="paragraphType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="h2" type="paragraphType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="p" type="paragraphWithImageType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="blockquote" type="blockquoteType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="pre" type="textOnly" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="ol" type="listType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="ul" type="listType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="hr" type="emptyType" maxOccurs="unbounded" minOccurs="0"/>
</xs:choice>
</xs:complexType>
<xs:group name="paragraphElements">
<xs:sequence>
<xs:element name="b" type="paragraphType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="i" type="paragraphType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="s" type="paragraphType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="u" type="paragraphType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="br" type="emptyType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="a" type="aType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="code" type="textOnly" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:group>
<xs:complexType name="paragraphType" mixed="true">
<xs:annotation>
<xs:documentation><![CDATA[
Elements allowed in a paragraph. It's not allowed to nest an element in itself. For example, it's not
possible to nest the bold tag like this: <b> something <b>super bold</b></b>.
]]></xs:documentation>
</xs:annotation>
<xs:choice maxOccurs="unbounded">
<xs:group ref="paragraphElements"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="paragraphWithImageType" mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:group ref="paragraphElements"/>
<xs:element name="img" type="imgType" maxOccurs="unbounded" minOccurs="0"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="aType" mixed="true">
<xs:complexContent>
<xs:extension base="paragraphType">
<xs:attribute name="href" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="blockquoteType" mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:group ref="paragraphElements"/>
<xs:element name="p" type="paragraphType"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="listType">
<xs:annotation>
<xs:documentation><![CDATA[
Elements representing ordered and unordered lists. When nesting lists, it is required that the nested
list (<ul|ol> tag) is the last element of the enclosing list item (<li>) tag.
For example, this is not allowed:
<ol>
<li>list item 1</li>
<li>list item 2
<ol>
<li>nested list item</li>
</ol>
this text element is not allowed to be here
</li>
</ol>
]]></xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element name="li" type="liType" maxOccurs="unbounded" minOccurs="1"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="liType" mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:group ref="paragraphElements"/>
<xs:element name="img" type="imgType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="p" type="paragraphWithImageType" maxOccurs="unbounded" minOccurs="0"/>
<xs:element name="ol" type="listType" minOccurs="0"/>
<xs:element name="ul" type="listType" minOccurs="0"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="imgType">
<xs:attribute name="src" type="xs:anyURI"/>
<xs:attribute name="alt" type="xs:string"/>
<xs:attribute name="title" type="xs:string"/>
</xs:complexType>
<xs:simpleType name="textOnly">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:complexType name="emptyType"/>
</xs:schema>