<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2007/05/moki" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:moki="http://www.w3.org/2007/05/moki">
	<xs:annotation><xs:documentation>
		<p>This is the schema for MOKI, the MobileOK Intermediate document format.</p>
		<p>moki was produced as part of the <a>mobileOK Checker project</a>, to allow the
			representation of an HTML resource and all its associated resources together,
			in order to allow the checking of that HTML resource for mobileOK conformance.</p>
		<p>moki represents aspects of the HTTP retrieval of a resource, provides the ability to encode the content of the resource and to attach specific metadata about resources, concerning their size, validity and so on.</p>
		<p>Although moki was created for the specific purpose of being processed by 
			XSLT to provide a "results" document containing the results of the mobileOK Basic Tests (hence it being termed "intermediate"), its possible uses are more general than that. No additional use cases were taken into account in its design and it is likely that it would need to be extended or modified to accommodate other applications.</p>
		<p>That said, the mobileOK checker itself does not currently exploit all moki features.</p>
		<p>Moki was developed and elaborated by members of the mobile OK Checker Task Force from an initial design by Jo Rabin.</p>
		<p>For more information on the mobileOK Basic Tests, please refer to the <a href="http://www.w3.org/TR/mobileOK-basic10-tests/">W3C mobileOK Basic Tests 1.0</a> specification.</p>
		<p>Comments about moki should be sent to the Checker Task Force mailing list (see <a href="">archives</a>), <a href="mailto:public-mobileOK-checker@w3.org">public-mobileOK-checker@w3.org</a>. </p>
		<p>Editor: Jo Rabin</p>
		<p>Date: 02 November 2008</p>
		<p>This Version: <a href="http://dev.w3.org/2007/mobileok-ref/moki/schema/moki-20081204.xsd">http://dev.w3.org/2007/mobileok-ref/moki/schema/moki-20081204.xsd</a></p>
		<p>Latest Version: <a href="http://dev.w3.org/2007/mobileok-ref/moki/schema/moki.xsd">http://dev.w3.org/2007/mobileok-ref/moki/schema/moki.xsd</a></p>
		<p>Previous Version: <a href="http://dev.w3.org/2007/mobileok-ref/moki/schema/moki-20071022.xsd">http://dev.w3.org/2007/mobileok-ref/moki/schema/moki-20071022.xsd</a></p>
		<p>Status: stable, the mobileOK Basic Tests 1.0 is a W3C Proposed Recommendation</p>
		<p>$Id: moki-20081204.xsd,v 1.1 2008-12-04 16:57:45 fd Exp $</p>
		<p>
			<small><a rel="Copyright" href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2005-2008 <a href="http://www.w3.org/">
				<acronym title="World Wide Web Consortium">W3C</acronym>
			</a><sup>©</sup> (<a href="http://www.csail.mit.edu/">
				<acronym title="Massachusetts Institute of Technology">MIT</acronym>
			</a>, <a href="http://www.ercim.org/">
				<acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym>
			</a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>, <a rel="Copyright" href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</small>
		</p>
	</xs:documentation></xs:annotation>
	
  <xs:element name="moki">
  	<xs:annotation><xs:documentation><p>The root element of a moki document.</p>  
  	</xs:documentation></xs:annotation>		
  	
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:aboutMe" minOccurs="0"/>
        <xs:element ref="moki:primaryDoc"/>
        <xs:element ref="moki:stylesheets"/>
        <xs:element ref="moki:images"/>
        <xs:element ref="moki:objects"/>
        <xs:element ref="moki:links"/>
      </xs:sequence>
    	<xs:attribute name="version" default="0.8"/>
    </xs:complexType>
  </xs:element>
	<xs:element name="timestamp">
		<xs:annotation><xs:documentation>
			<p>A timestamp of when the retrieval activity started.</p>
			<p>The value should be the number of milliseconds elapsed since January 1, 1970 UTC.</p>
		</xs:documentation></xs:annotation>
	</xs:element>
  <xs:element name="aboutMe">
  	<xs:annotation><xs:documentation><p>Information about the process carrying out the assembly of the resources into moki format.</p>
  	</xs:documentation></xs:annotation>
  	
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:name"/>
        <xs:element ref="moki:URI"/>
        <xs:element ref="moki:version"/>
        <xs:element ref="moki:callingIP"/>
      	<xs:element ref="moki:timestamp"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
	<xs:element name="name" type="xs:string">
		<xs:annotation><xs:documentation>
			<p>The name of a processing component.</p>
		</xs:documentation></xs:annotation>
	</xs:element>
	<xs:element name="version" type="xs:string">
		<xs:annotation><xs:documentation>
			<p>The version of a processing component.</p>
		</xs:documentation></xs:annotation>		
	</xs:element>
	<xs:element name="callingIP" type="xs:string">
		<xs:annotation><xs:documentation>
			<p>The IP Address of the component generating the moki document.</p>
			<p>Since servers may vary the representation of resources based on IP address, this field is significant, though it is understood that address translation (NAT) may be in operation, so the IP address assigned to the component compiling the moki document may not be that received by the remote servers. Where possible, therefore, the address inserted here should be that after address translation.</p>
		</xs:documentation></xs:annotation>
		
	</xs:element>
  <xs:element name="primaryDoc">
  	<xs:annotation><xs:documentation>
  		<p>This element contains information about the primary resource, i.e. the resource that is the subject of the moki document. The element contains details of the document's HTTP retrieval followed by details of the document itself.</p>
  	</xs:documentation></xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:retrieval"/>
        <xs:element ref="moki:XHTMLDocInfo"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="XHTMLDocInfo">
  	<xs:annotation><xs:documentation>
  		<p>Details of the primary document, which is assumed to be an XHTML document.</p>
  	</xs:documentation></xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:validity"/>
        <xs:element ref="moki:chars"/>
        <xs:element ref="moki:xmlDecl"/>
        <xs:element ref="moki:doctypeDecl"/>
        <xs:element ref="moki:docContent"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
	<xs:element name="validity">
		<xs:annotation><xs:documentation>
			<p>This element describes validity aspects of the primary document. The "valid" attribute summarises the validity status - it is true if all aspects of validity are true.</p>
			<p><em>The mobileOK Checker incorrectly produces a validity element as a child element of the imageInfo element. It should rather produce an imageValidity element (whose definition it actually respects).</em></p>
		</xs:documentation></xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="moki:UTF-8Validity"/>
				<xs:element ref="moki:MarkupValidity"/>
				<xs:element ref="moki:MobileValidity"/>
			</xs:sequence>
			<xs:attribute name="valid" type="xs:boolean"/>
		</xs:complexType>
	</xs:element>
	
  <xs:element name="chars">
  	<xs:annotation><xs:documentation>
  		<p>The number of characters in the document and the number of white space characters that are extraneous (as defined in mobileOK Basic Tests <a href="http://www.w3.org/TR/mobileOK-basic10-tests/#MINIMIZE">MINIMIZE</a>.</p>
  		<p><em>Not sure whether the "total" here is different to the "size" of the final HTTP retrieval's body entity.</em></p>
  	</xs:documentation></xs:annotation>
    <xs:complexType>
      <xs:attribute name="extraneous" use="required" type="xs:integer"/>
      <xs:attribute name="total" use="required" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="xmlDecl">
  	<xs:annotation><xs:documentation>
  		<p>Details of the XML declaration of the primary document. "declaration" indicates the presence or otherwise of an XML declaration, encoding indicates the declared character encoding, absent if none.</p>
  		<p><em>Missing: version? Absent indicates no version declared, present, the version declared.</em></p>
  	</xs:documentation></xs:annotation>
    <xs:complexType>    	
      <xs:attribute name="declaration" use="required" type="xs:boolean"/>
      <xs:attribute name="encoding" use="required" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="doctypeDecl">
  	<xs:annotation><xs:documentation>
  		<p>Details of any DOCTYPE declaration that may be present.</p>
  	</xs:documentation></xs:annotation>
    <xs:complexType>
      <xs:attribute name="publicID" use="required" type="xs:string"/>
      <xs:attribute name="systemID" use="required" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="docContent">
  	<xs:annotation><xs:documentation>
  		<p>The HTML content of the document, tidied if necessary to make it correct. The original untidied version is found as the entity body of the final HTTP request. The content is tidied if "Validity" of the parent element is false.</p>
  		<p><em>We should consider adding a "tidied" attribute to indicate this. Also it would be nice if we allowed for details of which tidy operations were carried out, they may not correspond exactly to the validity errors.</em></p>
  		
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
      	<xs:any namespace="http://www.w3.org/1999/xhtml"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="stylesheets">
  	<xs:annotation><xs:documentation>
  		<p>A collection of style sheet information associated with the document.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:stylesheet"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="stylesheet">
  	<xs:annotation><xs:documentation>
  		<p>An aspect of the style sheet information associated with the document - which might be an external style, a style element ("embedded") or "in line" style. The URI element refers to where the reference to the style sheet was found, rather than the URI of the style sheet itself.</p>
  		<p><em>POssibly missing here is a more precise reference to where the style was found - especially for "inline".</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:URI"/>
      	<xs:element ref="moki:retrieval" minOccurs="0"/>
      	<xs:element ref="moki:chars" minOccurs="0"/>
        <xs:element ref="moki:CSSValidity"/>
      </xs:sequence>
  		<xs:attribute name="type" use="required">
  			<xs:simpleType><xs:restriction base="xs:string"><xs:enumeration value="embedded"/><xs:enumeration value="inline"/><xs:enumeration value="external"/></xs:restriction></xs:simpleType>
  		</xs:attribute>
    </xs:complexType>
  </xs:element>
	
  <xs:element name="images">
  	<xs:annotation><xs:documentation>
  	<p>A collection of the images that were found in the primary document and in the style sheets associated with the primary document (as background or as list item images. The list contains only one reference for each image, caching considerations being equal.</p>	
  		<p><em>Ideally each image would contain a list of references that caused its retireval.</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="moki:image"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="image">
  	<xs:annotation><xs:documentation>
  		<p>Information about the retrieved image, its URI, details of its HTTP retrieval and basic image information.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:URI"/>
        <xs:element ref="moki:retrieval"/>
        <xs:element ref="moki:imageInfo"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="imageInfo">
  	<xs:annotation><xs:documentation>
  		<p>Information about an image. The "type" attribute denotes the Internet Content Type (mime type) of the image. Validity contains information about whether the document is a valid instance of that image type, transparency denotes whether the whole image is transparent, and actualDimensions determines the actual pixel dimensions of images that have an intrinsic size in pixels. Dimensions may be absent for image types that do not support that features. </p>
  		<p><em>The mobileOK Checker incorrectly produces a validity child element instead of the imageValidity element it should produce. </em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:imageValidity"/>
        <xs:element ref="moki:transparency"/>
        <xs:element ref="moki:actualDimensions" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="type" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="transparency">
  	<xs:annotation><xs:documentation>
  		<p>The "transparent" attribute is true if all the pixels of an image are transparent.</p>
  		<p><em>This would probably be better as an attribute.</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:attribute name="transparent" use="required" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="actualDimensions">
  	<xs:annotation><xs:documentation>
  		<p>The actual dimensions in pixels of images that have an intrinsic size.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:attribute name="height" use="required" type="xs:integer"/>
      <xs:attribute name="width" use="required" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="objects">
  	<xs:annotation><xs:documentation>
  		<p>A collection of objects found in the document - i.e. the referrent of "object" elements. A resource is only contained once in the list, even if it is referred to multiple times, caching considerations being equal. An image that is referred to as an Object is placed under the images element of a moki document.</p>
  		<p><em>It would be worth giving some thought as to whether the images list and the objects list should be combined.</em></p>
  		<p><em>It would be worth giving some thought as to how to represent the dependent relationships between objects.</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="moki:object"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="object">
  	<xs:annotation><xs:documentation>
  		<p>The referrent of an object element in the primary document.</p>
  		<p><em>Ideally, each object would reference where it was found in the referring document.</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:URI"/>
        <xs:element ref="moki:retrieval"/>
        <xs:element ref="moki:objectInfo"/>
      	<xs:element ref="moki:imageInfo" minOccurs="0"/> 
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="objectInfo">
  	<xs:annotation><xs:documentation>
  		<p>Contains information about the object:</p>
  		<ul>
  			<li>
  				the "<em>loadtype</em>" attribute specifies how the object would be handled by browsers:
  				<ul>
  					<li>"<em>RENDERED</em>" means the object would be rendered</li>
  					<li>"<em>TASTED</em>" means the object would not be rendered but would need to be retrieved to render the document</li>
  					<li>"<em>SKIPPED</em>" means the object would not be retrieved</li>
  				</ul>
			</li>
  			<li>the "<em>type</em>" attribute specifies the Internet Content Type found on retrieval of the object.</li>
  		</ul>	
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
  		<xs:attribute name="loadtype" use="required">
  			<xs:simpleType>
  				<xs:restriction base="xs:token">
  					<xs:enumeration value="RENDERED" />
  					<xs:enumeration value="TASTED" />
  					<xs:enumeration value="SKIPPED" />
  				</xs:restriction>
  			</xs:simpleType>
  		</xs:attribute> 
      	<xs:attribute name="type" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="links">
  	<xs:annotation><xs:documentation>
  		<p>All the targets of anchor (&lt;a&gt;) elements found in the primary document.</p>
  		<p><em>Should be one element per target and references to where they were found?</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="moki:link"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="link">
  	<xs:annotation><xs:documentation>
  		<p>Information about the retrieval of a document referenced by hyperlink.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:URI"/>
        <xs:element ref="moki:retrieval"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="URI" type="xs:anyURI"/>
	
  <xs:element name="retrieval">
  	<xs:annotation><xs:documentation>
  		<p>Details of the HTTP interaction involved in retrieving a document. The retrieved URI is the absolute URI retrieved (as opposed to a possibly relative URI referenced in the document). This is followed by the sequence of requests and responses involved in obtaining the resource.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:retrievedURI"/>
        <xs:sequence maxOccurs="unbounded">
          <xs:element ref="moki:HTTPRequest"/>
          <xs:element ref="moki:HTTPResponse"/>
        </xs:sequence>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="retrievedURI" type="xs:anyURI"/>
  <xs:element name="HTTPRequest">
  	<xs:annotation><xs:documentation>
  		<p>An XML representation of the request. Raw headers if present, represents the string that actually sent as headers. timeStart can be used to enable timing of the request.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="moki:rawHeaders"/>
        <xs:element ref="moki:method"/>
        <xs:element ref="moki:URI"/>
        <xs:element ref="moki:protocol"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="moki:header"/>
      </xs:sequence>
  		<xs:attribute name="timeStart" type="xs:dateTime"/>
  	</xs:complexType>
  </xs:element>
	<xs:element name="method" type="xs:string">
		<xs:annotation><xs:documentation><p>The HTTP method (GET, POST etc.) of a request.</p></xs:documentation></xs:annotation>
	</xs:element>
  <xs:element name="HTTPResponse">
  	<xs:annotation><xs:documentation>
  		<p>An XML representation of an HTTP response.  Raw headers if present, represents the string that was parsed to create the headers. timeStart and timeEnd can be used to track more precise timings of responses.</p>
  		<p><em>Need to represent failure of underlying DNS or TCP</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element ref="moki:rawHeaders" minOccurs="0"/>
        <xs:element ref="moki:protocol"/>
        <xs:element ref="moki:status"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="moki:header"/>
        <xs:element ref="moki:entity"/>
      </xs:sequence>
      <xs:attribute name="timeEnd" type="xs:dateTime"/>
      <xs:attribute name="timeStart" type="xs:dateTime"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="status">
  	<xs:annotation><xs:documentation>
  		<p>This is the HTTP response status line with code (e.g. 200) and reason (e.g. OK).</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:attribute name="code" use="required" type="xs:integer"/>
      <xs:attribute name="reason" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="entity">
  	<xs:annotation><xs:documentation>
  		<p>The HTTP entity body (i.e. the raw body of the response). The body of this element can be omitted, if so the "encoding" attribute is omitted too. The size attribute must be present and is the size in bytes of the entity body after any transfer decoding has been applied (e.g. if the transfer coding was gizp, size refers to the exploded version). The encoding attribute must be present if element content is present and is "escaped" for escaped text coding and "base64" for images etc.</p>
  		<p><em>At present this is not the way the aplha release works.</em></p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType mixed="true">
      <xs:attribute name="size" use="required" type="xs:integer"/>
  		<xs:attribute name="encoding" >
  			<xs:simpleType><xs:restriction base="xs:string">
  				<xs:enumeration value="base64"/>
  				<xs:enumeration value="escaped"/>
  			</xs:restriction></xs:simpleType>	
  		</xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="rawHeaders">
  	<xs:annotation><xs:documentation>
  	<p>The raw content of the HTTP headers as send across the TCP connection.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType mixed="true">
      <xs:attribute name="size" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
	<xs:element name="protocol" type="xs:string">
		<xs:annotation><xs:documentation>
			<p>HTTP/1.1 and so on.</p>
		</xs:documentation></xs:annotation>
		
	</xs:element>
  <xs:element name="header">
  	<xs:annotation><xs:documentation>
  		<p>An HTTP header. This can take two forms:</p>
  		<p>The first form take a "name" parameter and a "value" parameter. This is the form used when no structural decomposition of the header can usefully be performed or when the HTTP parameter name is not recognized.</p>
  		<p>The second form take a "name" has no "value" parameter, but contains a sequence of "moki:element" elements. This is the form used when the parameter has a structure analogous to that specified in RFC 822, where the value of the header can be a comma separated list and where elements of the list may have parameters attached to them with semi-colons, examples being "Accept" (e.g. <code>Accept: application/xhtml+xml, text/html;q=0.1, text/plain;q=0.1</code>) and "Cache-Control" - (e.g. <code>Cache-Contol: max-age=0, no-transform</code>. In these cases, analysis using XSLT or other XML aware processing tools is facilitated by using the "moki:element" and "moki:parameter" elements.</p>
  		<p>The mobileOK checker uses this form for the HTTP headers listed in <a href="http://dev.w3.org/cvsweb/2007/mobileok-ref/src/org/w3c/mwi/mobileok/basic/HeaderParseMethod.java?rev=1.4&amp;content-type=text/x-cvsweb-markup">HeaderParseMethod</a> as <code>PARSE_AND_NORMALIZE</code> and <code>PARSE_BUT_DO_NOT_NORMALIZE</code> and additionally performs white-space and case normalization on headers shown in that file as <code>PARSE_AND_NORMALIZE</code>.</p>
  		  		<p>HTTP header names are normalized to lower case in all cases.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="moki:element"/>
      </xs:sequence>
      <xs:attribute name="name" use="required" type="xs:string"/>
      <xs:attribute name="value"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="element">
  	<xs:annotation><xs:documentation>
  		<p>Elements of HTTP headers that are defined as being comma separated lists. Each element of the list is represented by a separate "moki:element" element, and those that have values (e.g. max-age=0) have the "value" attribute set appropriately.</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="moki:parameter"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="value" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="parameter">
  	<xs:annotation><xs:documentation>
  		<p>Some elements of HTTP headers (the elements of comma separated lists in the original header value) have parameters which are separated from the list element by a semi-colon. Each parameter is represented by a separate "moki:parameter" element, whose name and value are represented using the repsective attribute (e.g. q=0.1).</p>
  	</xs:documentation></xs:annotation>
  	<xs:complexType>
      <xs:attribute name="name" use="required" type="xs:string"/>
      <xs:attribute name="value" use="required" type="xs:string"/>
    </xs:complexType>
  </xs:element>
	
	<xs:complexType name="validityType">
		<xs:annotation><xs:documentation>
			<p>The underlying type for moki error reporting.</p>
		</xs:documentation></xs:annotation>
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element ref="moki:error"/>
			<xs:element ref="moki:warning"/>
		</xs:choice>
		<xs:attribute name="valid" use="required">
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:enumeration value="VALID"/>
					<xs:enumeration value="INVALID"/>
					<xs:enumeration value="NOT_VALIDATED"/>
					<xs:enumeration value="true"/>
					<xs:enumeration value="false"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	
	<xs:element name="CSSValidity" type="moki:validityType">
		<xs:annotation><xs:documentation>
			<p>Details of CSS errors and warnings, if any. Overall validity (no errors) indicated by "valid" attribute being true.</p>
		</xs:documentation></xs:annotation>
	</xs:element>
	
	<xs:element name="imageValidity" type="moki:validityType">
		<xs:annotation><xs:documentation>
			<p>Details of image errors and warnings, if any. Overall validity (no errors) indicated by "valid" attribute being true.</p>
		</xs:documentation></xs:annotation>
	</xs:element>
	
	<xs:element name="UTF-8Validity" type="moki:validityType">
		<xs:annotation><xs:documentation>
			<p>Records errors and warnings when evaluating UTF-8 validity</p>			
		</xs:documentation></xs:annotation>
	</xs:element>
	<xs:element name="MarkupValidity" type="moki:validityType">
		<xs:annotation><xs:documentation>
			<p>Records errors and warnings when evaluating against the provided DOCTYPE</p>			
		</xs:documentation></xs:annotation>
	</xs:element>
	<xs:element name="MobileValidity" type="moki:validityType">
		<xs:annotation><xs:documentation>
			<p>Records errors and warnings when evaluating against XHTML Basic 1.1</p>
		</xs:documentation></xs:annotation>
	</xs:element>
	
	<xs:complexType name="errorWarnType">
		<xs:annotation><xs:documentation>
			<p>The underlying type for moki error and warning details.</p>
			<p><em>Possibly need to allow for more than one info to allow for multi-lingual reporting.</em></p>
			<p><em>More than one position to allow for multiple errors of same type?</em></p>
			
		</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element ref="moki:info"/>
			<xs:element ref="moki:position"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:element name="error" type="moki:errorWarnType">
		<xs:annotation><xs:documentation>
			<p>Records a validity error.</p>
		</xs:documentation></xs:annotation>		
	</xs:element>
	
	<xs:element name="warning" type="moki:errorWarnType">
		<xs:annotation><xs:documentation>
			<p>Records a validity warning.</p>
		</xs:documentation></xs:annotation>				
	</xs:element>
	
	<xs:element name="info">
		<xs:annotation><xs:documentation><p>A textual description of the error</p> 
		<p><em>Probably needs to be elaborated with xml:lang, and potentially a language neutral code</em></p></xs:documentation></xs:annotation>
		<xs:complexType mixed="true"/>
	</xs:element>
	
	<xs:element name="position">
		<xs:annotation><xs:documentation>
			<p>Specifies the location in the resource where the error occurs.</p>
			<p> <em>Seemingly a simple matter, actually ver difficult to populate given the information that is returned by validity checkers. In principle there are a number if types of position information, e.g. for character validation you'd prefer a character offset, for binary format a byte offset and so on.</em></p>
		</xs:documentation></xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="moki:line"/>
				<xs:element ref="moki:column" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="type">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="LINE_COLUMN"></xs:enumeration>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="line" type="xs:positiveInteger">
<xs:annotation>	<xs:documentation>	<p>The line offset into a line oriented resource. Starting from 0.</p></xs:documentation>
</xs:annotation>	</xs:element>
	
	<xs:element name="column" type="xs:positiveInteger">
		<xs:annotation>	<xs:documentation>	<p>The column offset into a line oriented resource. Starting from 0.</p></xs:documentation>
		</xs:annotation>	</xs:element>
	
</xs:schema>

