<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <!--
    relaxng schema for CodeSonar's XML output
    std_grid_entry is the standard structure for a grid entry
  -->
  <xs:attributeGroup name="std_grid_entry">
    <xs:attribute name="url"/>
  </xs:attributeGroup>
  <xs:element name="s">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="c"/>
      </xs:sequence>
      <xs:attribute name="comment" type="xs:boolean"/>
      <xs:attribute name="grayout" type="xs:boolean"/>
      <xs:attribute name="unreachable" type="xs:boolean"/>
      <xs:attribute name="keyword" type="xs:boolean"/>
      <xs:attribute name="string" type="xs:boolean"/>
      <xs:attribute name="macro" type="xs:boolean"/>
      <xs:attribute name="preprocessor" type="xs:boolean"/>
      <xs:attribute name="taint"/>
      <xs:attribute name="linksfid"/>
      <xs:attribute name="interesting" type="xs:boolean"/>
      <xs:attribute name="opcode" type="xs:boolean"/>
      <xs:attribute name="label" type="xs:boolean"/>
      <xs:attribute name="linklocal" type="xs:boolean"/>
      <xs:attribute name="loop" type="xs:boolean"/>
      <xs:attribute name="mclose" type="xs:boolean"/>
      <xs:attribute name="on_path" type="xs:boolean"/>
      <xs:attribute name="super_interesting" type="xs:boolean"/>
      <xs:attribute name="refs"/>
      <xs:attribute name="linkline" type="xs:integer"/>
      <xs:attribute name="include" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="c" type="xs:string"/>
  <xs:element name="vtx_info">
    <xs:complexType>
      <xs:attribute name="loc" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:group name="code_grid_entry">
    <xs:sequence>
      <xs:element minOccurs="0" ref="vtx_info"/>
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="s"/>
    </xs:sequence>
  </xs:group>
  <xs:element name="permissions_link">
    <xs:complexType>
      <xs:attribute name="url" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="states" type="stateGridRef"/>
  <xs:complexType name="stateGridRef">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="state"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="state">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="id"/>
        <xs:element minOccurs="0" ref="label"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="id">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="label">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
