Unicorn Response specification

Presentation

In future versions, we plan to replace this with RDF that could be "mapped" to any XML format. This RDF will provide classes such as Error or Column, but as this is quite hard to implement, we chose a simpler first solution: impose a generic output to each observer.

This output is a XML document conforming to a particular schema, and will probably imply to write a specific output on each observer.

But whatever the choice, the different solutions will provide the same features.

To write this XML schema, we used the document http://esw.w3.org/topic/MarkupValidator/M12N.

This schema should be able to fit any observer needs, but, if not, we hope it will be extensible.

Description of the elements

Observationresponse

The observationresponse element forms the root of a response and contains the following elements :

Result

The result element is the container for all the messages produced during the observation. It can contain zero or one of the following:

Errors, warnings and informations

These three elements are built on the same model:

Errorlist, warninglist and infolist

Each list contains can contain:

Error

An error element can contain zero or one of the following:

It must also contain at least one message element and can contain several longmessage element. These elements will contain descriptions of the error.

Warning

A warning element can contain zero or one of the following:

It must also contain at least one message element and can contain several longmessage element. These elements will contain descriptions of the warning.

Info

An info element can contain zero or one of the following:

It must also contain at least one message element and can contain several longmessage element. These elements will contain descriptions of the info.

Long message

A longmessage element can contain one or more of the following:

Full schema

The schema of an observation response can be found at observer-response.xsd.

Sample response document

<?xml version='1.0' encoding="utf-8"?>
<observationresponse xmlns="http://www.w3.org/unicorn/observationresponse"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.w3.org/unicorn/observationresponse http://www.w3.org/QA/Tools/Unicorn/response/observer-response.xsd">
  <uri>http://example.org</uri>
  <checkedby>http://jigsaw.w3.org/css-validator/</checkedby>
  <version>css2</version>
  <date>2006-05-22T11:22:54</date>
  <passed>false</passed>
  <result>

    <errors xml:lang="en">
      <errorcount>5</errorcount>
      <errorlist>
        <uri>http://www.example.org/style.css</uri>
        <errorcount>3</errorcount>
        <error>
          <line>331</line>
          <column>10</column>
          <errortype>semantic</errortype>
          <context>div.citation, div.spoiler</context>
          <message>The property -moz-border-radius doesn't exist.</message>
        </error>
        <error>
          <line>344</line>
          <errortype>semantic</errortype>
          <context>table#navbar</context>
          <message>The property -moz-border-radius doesn't exist.</message>
        </error>
        <error>
          <line>347</line>
          <errortype>semantic</errortype>
          <context>table#navbar td.alt2</context>
          <message>The property -moz-border-radius-topleft doesn't exist.</message>
        </error>
      </errorlist>

      <errorlist>
        <uri>http://www.example.org/style2.css</uri>
        <errorcount>2</errorcount>
        <error>
          <line>328</line>
          <errortype>semantic</errortype>
          <context>div.citation, div.spoiler</context>
          <message>The property -moz-border-radius doesn't exist.</message>
        </error>
        <error>
          <line>341</line>
          <errortype>semantic</errortype>
          <context>table#navbar</context>
          <message>The property -moz-border-radius doesn't exist.</message>
        </error>
      </errorlist>
    </errors>

    <warnings xml:lang="en">
      <warningcount>0</warningcount>
    </warnings>

    <miscmessages xml:lang="en">
      <miscmessagecount>1</miscmessagecount>

      <miscmessagelist>
        <uri>http://example.org</uri>
        <miscmessage>
          <message>You should also try to validate XHTML</message>
          <longmessage> CSS works better with valid XHTML. Check the document using the
            markup-validator (http://validator.w3.org). </longmessage>
        </miscmessage>
      </miscmessagelist>

    </miscmessages>
  </result>
</observationresponse>