<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           elementFormDefault="qualified"
           targetNamespace="http://jboss.com/products/webbeans/tck/audit"
           xmlns:audit="http://jboss.com/products/webbeans/tck/audit"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"
           >
           
  <xs:element name="specification">
    <xs:annotation>
      <xs:documentation> The specification tag is the root element for tck-audit.xml. </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element ref="audit:section"/>
      </xs:sequence>
      <xs:attribute name="name" type="xs:string"/>
      <xs:attribute name="version" type="xs:string"/>
    </xs:complexType>
  </xs:element>           
  
  <xs:element name="section">
    <xs:annotation>
      <xs:documentation>Each section of the specification should be identified and entered</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="audit:assertion"/>
      </xs:sequence>
      <xs:attributeGroup ref="audit:attlist.section"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.section">
    <xs:attribute name="id" type="xs:string">
      <xs:annotation>
        <xs:documentation>The section number</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="title" type="xs:string">
     <xs:annotation>
         <xs:documentation>The section title</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>  
    
  <xs:element name="assertion">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="1" ref="audit:text">
           <xs:annotation>
             <xs:documentation>The specification text that this assertion represents. You can include highlighting such as _highlight_ or ~score out~.</xs:documentation>
           </xs:annotation>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" ref="audit:note">
          <xs:annotation>
             <xs:documentation>A note on the assertion, for example a justifaction for marking this assertion untestable</xs:documentation>
           </xs:annotation>
        </xs:element>
      </xs:sequence>
      <xs:attributeGroup ref="audit:attlist.assertion"/>
    </xs:complexType>
  </xs:element>
  
  <xs:attributeGroup name="attlist.assertion">
    <xs:attribute name="id" type="xs:string"/>
    <xs:attribute name="testable" type="xs:boolean" default="true">
      <xs:annotation>
        <xs:documentation>By default true, set to false if this test is untestable. The coverage report will then not count it as untested.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="implied" type="xs:boolean" default="true">
      <xs:annotation>
        <xs:documentation>Some assertions are often implied by the specification (for example inversions of statments), mark an assertion as implied using this attribute.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>
  
  <xs:element name="text">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string"/>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="note">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string"/>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  
</xs:schema>