<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <!--
    metrics
      relaxng schema for CodeSonar's XML output
      generated via template metric_search_results.xml
  -->
  <!--
    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="metrics" type="metricssGridRef"/>
  <xs:complexType name="metricssGridRef">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="metric"/>
      <xs:element ref="iteration_failure"/>
    </xs:choice>
  </xs:complexType>
  <xs:element name="metric">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" ref="analysis_name"/>
        <xs:element minOccurs="0" ref="file"/>
        <xs:element minOccurs="0" ref="file_path"/>
        <xs:element minOccurs="0" ref="directory"/>
        <xs:element minOccurs="0" ref="compilation_unit_path"/>
        <xs:element minOccurs="0" ref="compilation_unit"/>
        <xs:element minOccurs="0" ref="line_number"/>
        <xs:element minOccurs="0" ref="name"/>
        <xs:element minOccurs="0" ref="description"/>
        <xs:element minOccurs="0" ref="language"/>
        <xs:element minOccurs="0" ref="procedure"/>
        <xs:element minOccurs="0" ref="granularity"/>
        <xs:element minOccurs="0" ref="value"/>
      </xs:all>
      <xs:attribute name="url"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="analysis_name">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="file">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="file_path">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="directory">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="compilation_unit_path">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="compilation_unit">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="line_number">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="name">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="description">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="language">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="procedure">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="granularity">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="value">
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="std_grid_entry"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="iteration_failure" type="xs:string"/>
</xs:schema>
