<?xml version="1.0" encoding="UTF-8"?>
<!-- targetNameSpace says where locally defined elements go. This is optional.
       targetNamespace="http://www.aaa.bbb.ccc/dir1/dir2" -->
<!-- xmlns is the default nameSpace. Not needed if there is no target name space.
       xmlns="http://www.aaa.bbb.ccc/dir1/dir2" -->
<!-- elementFormDefault demands that all elements declared in any
     instance of this schema is name-space qualified -->
<!-- Comment #1:
     Can we have a formal namespace declaration for the schema?
     Yes, we can - but I would rather you define it at CCP4, because the involvement of the EBI is
     coming to an end.
 -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xsd:annotation>
    <xsd:documentation> This BioXHIT/CCP4 data-tracking schema describes the information accumulated during the processing of experiments in biological X-ray crystallography.
    </xsd:documentation>
  </xsd:annotation>

<!-- Comment #2:
     GW says that the following element "Bioxhit_data_tracking" is broken
     if he attempts to load the XSD into Microsoft Development Environment
     (Design) in visual studio.net.
     He believes that it should have addition "ComplexType" and "Sequence"
     declarations.
     Sorted.
-->

  <xsd:element name="BioXHIT_data_tracking">
    <xsd:annotation>
      <xsd:documentation>Data tracking for the entire process of deriving coordinates
	   from an X-ray crystallographic experiment.

<!-- Comment #3:
     Generally: can we have documentation/descriptions for *all* the elements,
     either at the head of each ComplexType declaration or (more preferably)
     in each individual element declaration?
     Done.
-->

      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="project_name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
          <xsd:annotation>
            <xsd:documentation>An identifying name for the project, corresponding to CCP4i's PROJECT_NAME.
	    </xsd:documentation>

          </xsd:annotation>
        <xsd:element name="project_title" type="xsd:string" minOccurs="1" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>A descriptive title for the project</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="project_description" type="xsd:string" minOccurs="0" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>(Optional) Text with a longer description of the project (like an abstract)
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="experimental_data" type="experimentalDataType" minOccurs="1" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>Data items required for PDB REMARK 200</xsd:documentation>
          </xsd:annotation>
        </xsd:element>

<!-- Comment #4:
     Typo below: "final_cooridnate_set" should be "final_coordinate_set"
     Fixed.
-->

        <xsd:element name="final_coordinate_set" type="fileType" minOccurs="1" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>The coordinates of the final model being deposited</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="reflection_data_for_refinement" type="reflectionDataType" minOccurs="1" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>The reflection data used for refinement</xsd:documentation>
          </xsd:annotation>
        </xsd:element>
        <xsd:element name="reflection_data_for_phasing" minOccurs="0" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>List of reflection datasets used in phasing</xsd:documentation>
          </xsd:annotation>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="phasing_dataset" type="reflectionDataType" minOccurs="1" maxOccurs="unbounded">
                <xsd:annotation>
                  <xsd:documentation>One of a number of reflection datasets used for phasing</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="step" type="stepType" minOccurs="1" maxOccurs="unbounded">
          <xsd:annotation>
            <xsd:documentation>A step in the process of solving the structure and generating the final model. This could be a run of a CCP4i task or some other "driver application", a run of a script, some process of editing using a graphics program etc.
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>


  <xsd:complexType name="stepType">
    <xsd:annotation>
      <xsd:documentation>A major step in the processing.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="step_number" type="xsd:positiveInteger" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>A positive integer indicating the order of the steps. Step_numbers must be unique within a Deposit_history.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="step_title" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(Optional) A short description of the step. Corresponds to the TITLE attribute in CCP4i.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

<!-- Comment #4:
     GW asks if "previous_steps" a link? This was probably ambiguious in the
     original document. I think that I intended this to be a list of numbers
     corresponding to the step numbers declared elsewhere.
     A: The format below supports your intention: it is a complex type made up of any number of positive integer
     step numbers. It is not a link.
-->

      <xsd:element name="previous_steps" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>A list of Step_numbers indicating which previous steps provided data for input into this step (either explicitly as a data file or implicitly via logfile scraping) or which are related in some other way (for example because of application logic).
          </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="step_number" type="xsd:positiveInteger" minOccurs="1" maxOccurs="unbounded">
              <xsd:annotation>
                <xsd:documentation>A positive integer indicating the order of the steps. Step_numbers must be unique within a Deposit_history.
                </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="driver_application" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The driver application gives the context of the step. Driver applications could be CCP4i, HAPPy, XIA, Coot, or none (if the step was "manual").
          </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="application_name" type="xsd:string" minOccurs="1" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>documentation missing</xsd:documentation>
               </xsd:annotation>
            </xsd:element>
            <xsd:element name="application_version" type="xsd:string" minOccurs="1" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>documentation missing</xsd:documentation>
               </xsd:annotation>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="application_task_name" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>This is the name of the application-specific task that was run in this step, in the context of the driver application. For CCP4i this corresponds to the TASKNAME attribute, for example it could be a task such as "scala", "prehadata" or "refmac5".</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
<!-- Comment #5:
     GW tells me that there is a standard type within XSD for describing dates
     and times, so perhaps we should use that here instead.
     Done.
-->

      <xsd:element name="date" type="xsd:date" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The date and time that the step was completed by. Data type reference: http://book.xmlschemata.org/relaxng/ch19-77041.html
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="application_control_file" type="fileType" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>This is the application-specific file which contains parameters used to run the task. For example in CCP4i this would be the .def parameter file associated with the job. For other applications it could be a keyworded input script plus the command line. What is important is that the driver application knows how to make sense of this.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="pdb_extract_flag" type="pdbExtractFlag" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Records which step in the PDB_extract model of deposition this Step corresponds to. Its value is one from a list of values.
          </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="NONE"/>
            <xsd:enumeration value="HA_PHASING_MAD"/>
            <xsd:enumeration value="HA_PHASING_SAD"/>
            <xsd:enumeration value="HA_PHASING_SIR"/>
            <xsd:enumeration value="HA_PHASING_SIRAS"/>
            <xsd:enumeration value="HA_PHASING_MIR"/>
            <xsd:enumeration value="HA_PHASING_MIRAS"/>
            <xsd:enumeration value="MR"/>
            <xsd:enumeration value="DM"/>
            <xsd:enumeration value="REFINE"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>

      <xsd:element name="input_file" type="fileType" minOccurs="0" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>A data file used as input to the step, i.e. the inputs treating the step as a "black box" (more fine-grained detail can be included via the use of the Component_Substeps). For CCP4i this would be constructed from the INPUT_FILES and INPUT_FILES_DIR attributes.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="output_file" type="fileType" minOccurs="0" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>A data file output from the step, i.e. the outputs treating the step as a "black box"(more fine-grained detail can be included via the use of the Component_Substeps). For CCP4i this would be constructed from the OUTPUT_FILES and OUTPUT_FILES_DIR attributes.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="log_file" type="fileType" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The application-generated log file for the step - typically this is the text written to stdout by the application (for example, in the case of CCP4 programs).
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="component_substeps" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>This is a container for listing the Substeps that were run as part of the current Step. There may not be any Substeps for some applications (for example if the Step was the run of a single program) in which case the list of Component_substeps will be empty. In other cases there may be one or more Substeps which are defined by the driver application - for example in CCP4i the substeps are the individual programs run by the task in question.
          </xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="substep" type="substepType" minOccurs="0" maxOccurs="unbounded">
              <xsd:annotation>
                <xsd:documentation>A Substep is an application-defined part of the current Step. For example in CCP4i this would be a run of one program within a task e.g. the "scala" task might typically runs the programs SORTMTZ, SCALA, MTZDUMP, UNIQUE and so on - each of these would constitute a Substep within CCP4i. Within Coot, a run of REFMAC might constitute a Substep.
                </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>


  <xsd:complexType name="substepType">
    <xsd:annotation>
      <xsd:documentation>A substep of a major step in the processing.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="substep_number" type="xsd:positiveInteger" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>A positive integer that is unique within the current Step, to indicate the order of the Substeps. Compare Step_number.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="program_name" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The name of the program run in the substep</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="program_version" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(Optional) The version of the program run in the substep, in whatever format the program is versioned in.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="program_package" type="xsd:string" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(Optional) The name of the package that the program belongs to (if any). For example for SCALA it would be "CCP4", for shelxc it might be "SHELX".
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="program_package_version" type="xsd:string" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(optional) The version of the package that the program belongs to (if any), in the appropriate version format for that package.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="program_control_file" type="fileType" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(Optional) Simialar to Application_control_file - the application-specific file containing the parameters to run the program in this substep.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="input_file" type="xsd:string" minOccurs="1" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>A data file used as input to the step, i.e. the inputs treating the step as a "black box" (more fine-grained detail can be included via the use of the Component_Substeps). For CCP4i this would be constructed from the INPUT_FILES and INPUT_FILES_DIR attributes.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="output_file" type="xsd:string" minOccurs="1" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>A data file output from the step, i.e. the outputs treating the step as a "black box"(more fine-grained detail can be included via the use of the Component_Substeps). For CCP4i this would be constructed from the OUTPUT_FILES and OUTPUT_FILES_DIR attributes.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="log_file" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(Optional)The application-generated log file for the step - typically this is the text written to stdout by the application (for example, in the case of CCP4 programs).</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>


  <xsd:complexType name="experimentalDataType">
    <xsd:annotation>
      <xsd:documentation>Data items required for PDB REMARK 200
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="experiment_type" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>"X-Ray diffraction" (the only type dealt with by CCP4)
          </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">

<!-- Comment #6:
     GW asks if the value "X-ray diffraction" can't be uppercased, as is the
     case for the pdb_extract_flag defined and enumerated previously.
     I'm not sure I understand. I made the "R" in "X-Ray" uppercase. is this enough?
-->

            <xsd:enumeration value="X-Ray diffraction"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
        <xsd:element name="starting_model" type="xsd:string" minOccurs="1" maxOccurs="1">
          <xsd:annotation>
            <xsd:documentation>The initial model used for molecular replacement (and only for that)
            </xsd:documentation>
          </xsd:annotation>
        </xsd:element>
      <xsd:element name="data_collection" type="dataCollectionType" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Groups together data items related to the data collection
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

<!-- Comment #7:
     GW comments that maxOccurs should be "Unbounded" for the "data_processing"
     element below. I think that this is because multiple data processing runs
     can contribute to a single structure determination.
     Done.
-->

      <xsd:element name="data_processing" type="dataProcessingType" minOccurs="1" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>Groups together all the items related to the data processing
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="fileType">
    <xsd:annotation>
      <xsd:documentation>Describes a file
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>

<!-- Comment #8:
     Should we use the URI datatype instead of the three separate elements
     "fileName", "pathName" and "host"?
     Done.
-->
      <xsd:element name="file_ref" type="xsd:URI" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Reference to a file, with the following attributes:
Filename: the name of the file, with or without a leading path (e.g. /home/pjx/aucn.mtz or aucn.mtz)
Pathname: the full pathname of the directory that the file is in, if no path was supplied as part of the Filename
Host: (optional) the name of the host where the file resides
Format: the format that the file is written in, e.g. MTZ, PDB, CIF etc
Type: (optional) the type of data held in the file, e.g. harvest file, reflection data, coordinates, Refmac dictionary
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="format" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The format that the file is written in, e.g. MTZ, PDB, CIF etc
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(optional) the type of data held in the file, e.g. harvest file, reflection data, coordinates, Refmac dictionary
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>


  <xsd:complexType name="dataCollectionType">
    <xsd:annotation>
      <xsd:documentation>Conditions under which the data collection took place
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="date" type="xsd:date" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>date in the year (no time), in dd-mmm-yyyy format, or null
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="temperature" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>in degrees Kelvin
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ph" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>0-14 (of the crystal)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

<!-- Comment #9:
     Shouldn't wavelength be a float or real instead of a string?
     A: No, because it may be a range, e.g., xxx-yyy.
-->

      <xsd:element name="wavelength" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>angstroms, either a single wavelength (real number) or a range (two real numbers separated by a hyphen)
Possible cases:
-single wavelength (discrete)
-polychromatic (range: e.g., 1-1.5)
-Laue (range, as above)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="number_of_crystals" type="xsd:positiveInteger" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>the number of crystal used in the experiment
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="synchrotron" type="xsd:boolean" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Y/N
          </xsd:documentation>
        </xsd:annotation>

<!-- Comment #10:
     GW suggests using the standard Boolean datatype here (instead of
     enumerated values.
     Done.
-->
      </xsd:element>
      <xsd:element name="radiation_source" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>could describe the source of the X-rays - either internal generator (e.g., rotating anode) or synchrotron station (ESRF)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="beam_line" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>The identification of the synchrotron beamline (e.g., ID23)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="optics" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Free text. Describes the optices used in the X-ray source set up (e.g., mirrors)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="detector_type" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>the type of X-ray detector used (e.g., CCD, image plate)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="detector_manufacturer" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>manufacturer of above detector
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

<!-- Comment #11:
     For "x_ray_generator_model" GW suggests that minOccurs should be "0"
     since this may have been a synchrotron
     Done.
-->
      <xsd:element name="x_ray_generator_model" type="xsd:string" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>If radiation_source above is "internal", the model of the generator (e.g., RIGAKU RU3HR)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="monochromator" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Type of monochromator used
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="monochromatic_or_laue" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>"M" or "L"
          </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="m"/>
            <xsd:enumeration value="l"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>


  <xsd:complexType name="reflectionDataType">
    <xsd:annotation>
      <xsd:documentation>Describes the reflection data obtained at the experiment
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>

<!-- Comment #12:
     For PJB to address: the "reflectionDataType" needs to have more structure, can
     we revise at a later date if necessary?
-->
      <xsd:element name="reflection_file" type="fileType" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>documentation missing
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="crystal_id" type="xsd:string" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(Optional) Corresponds to the "crystal name" attribute in the MTZ file header
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="dataset_id" type="xsd:string" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>(Optional)Corresponds to the "dataset name" in the MTZ file header
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="mtz_column_label" type="xsd:string" minOccurs="1" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>(Only required for a file of type MTZ). An MTZ column label.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>


  <xsd:complexType name="dataProcessing">
    <xsd:annotation>

<!-- Comment #13:
     GW comments that he would like the documentation data here to be more
     specific about the scope of "processing" in this context, e.g. are we
     talking frames to intensities, or something else?
     A: can either of you expand on this? you know this much better than me.
-->
      <xsd:documentation>Information regarding the initial processing of the experimental data.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="data_processing_software" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="data_processing_step" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="data_scaling_software" type="xsd:string" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="data_scaling_step" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="resolution_range_high" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="resolution_range_low" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="rejection_criterion_sig_i" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="r_merge" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="r_sym" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="i_over_sig_i" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="completeness_for_range" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="data_redundancy" type="xsd:real" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="number_of_unique_reflections" type="xsd:positiveInteger" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

<!-- Comment #14:
     GW says that there is an XSD data type for dates and times, so perhaps we
     should use that instead? (see comment #5).
     Done.
-->

</xsd:schema>
