git-svn-id: https://subversion.xor.aps.anl.gov/synApps/areaDetector/trunk@13396 dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b
270 lines
9.6 KiB
XML
Executable File
270 lines
9.6 KiB
XML
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!--
|
|
########### SVN repository information ###################
|
|
# $Date$
|
|
# $Author$
|
|
# $Revision$
|
|
# $HeadURL$
|
|
# $Id$
|
|
########### SVN repository information ###################
|
|
-->
|
|
|
|
<!--
|
|
Use of this XML Schema file is deprecated.
|
|
Instead, use the Schematron file: template.sch
|
|
Schematron:
|
|
allows arbitrary element names
|
|
allows arbitrary UserGroup names
|
|
enforces one signal="1" attribute per NXdata group
|
|
cannot apply a regexp match for the allowed names
|
|
|
|
-->
|
|
|
|
<!-- usage:
|
|
xmllint - -noout - -schema /path1/NeXus_templates.xsd /path2/NX_template_file.xml
|
|
(put the two minus signs together for the actual command,
|
|
XML can't have them together in an XML file, even in a comment!
|
|
|
|
Note: This XML Schema validates the example files as-written in areaDetector
|
|
but is not sufficient for general use. It may be removed in future areaDetector releases.
|
|
-->
|
|
|
|
|
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
|
|
<xs:element name="NXroot" >
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element ref="Facility" minOccurs="0">
|
|
<xs:annotation>
|
|
<xs:documentation>
|
|
Facility is a legacy group from APS's CCDImageServer.
|
|
It is not a NeXus group and is used only by some custom at APS.
|
|
Not recommended for new projects.
|
|
</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:element>
|
|
<xs:element ref="NXentry" maxOccurs="unbounded"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="Facility">
|
|
<!-- legacy group from CCDImageServer, not a NeXus group and ignored -->
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="facility_name" type="commonElement"/>
|
|
<xs:element name="facility_sector" type="commonElement"/>
|
|
<xs:element name="facility_beamline" type="commonElement"/>
|
|
<xs:element name="facility_station" type="commonElement"/>
|
|
<xs:element name="facility_float" type="commonElement"/>
|
|
<xs:element name="facility_int" type="commonElement"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="type" use="required" fixed="UserGroup"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="NXentry">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="title" type="commonElement"/>
|
|
<xs:element name="experiment_identifier" type="commonElement"/>
|
|
<xs:element name="experiment_description" type="commonElement"/>
|
|
<xs:element name="experiment_documentation" type="commonElement"/>
|
|
<xs:element name="collection_identifier" type="commonElement"/>
|
|
<xs:element name="collection_description" type="commonElement"/>
|
|
<xs:element name="entry_identifier" type="commonElement"/>
|
|
<xs:element name="definition" type="commonElement"/>
|
|
<xs:element name="start_time" type="commonElement"/>
|
|
<xs:element name="end_time" type="commonElement"/>
|
|
<xs:element name="duration" type="commonElement"/>
|
|
<xs:element name="collection_time" type="commonElement"/>
|
|
<xs:element name="run_cycle" type="commonElement"/>
|
|
<xs:element name="program_name" type="commonElement"/>
|
|
<xs:element name="revision" type="commonElement"/>
|
|
<xs:element name="notes" type="commonElement"/>
|
|
<xs:element ref="NXuser" minOccurs="0"/>
|
|
<xs:element ref="NXdata" minOccurs="1" maxOccurs="unbounded"/>
|
|
<xs:element ref="NXinstrument" minOccurs="0"/>
|
|
<xs:element ref="NXcollection" minOccurs="0"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="NXuser">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="name" type="commonElement"/>
|
|
<xs:element name="role" type="commonElement"/>
|
|
<xs:element name="affiliation" type="commonElement"/>
|
|
<xs:element name="address" type="commonElement"/>
|
|
<xs:element name="telephone_number" type="commonElement"/>
|
|
<xs:element name="fax_number" type="commonElement"/>
|
|
<xs:element name="email" type="commonElement"/>
|
|
<xs:element name="facility_user_id" type="commonElement"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="NXdata">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="maxSizeX" type="commonElement"/>
|
|
<xs:element name="maxSizeY" type="commonElement"/>
|
|
<xs:element name="make" type="commonElement"/>
|
|
<xs:element name="model" type="commonElement"/>
|
|
<xs:element name="ImageCounter" type="commonElement" minOccurs="0" />
|
|
<!-- TODO: special attention needed here
|
|
This sets the name of the data to "data" which is not required by NeXus.
|
|
Also, it is necessary to require a signal="1" attribute definition
|
|
for only one dataset in the NXdata group:
|
|
<Attr name="signal" type="CONST" outtype="NX_CHAR">1</Attr>
|
|
|
|
Perhaps we need to switch from XML Schema to Schematron to validate template.xml files?
|
|
-->
|
|
<xs:element name="data" type="dataElement"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="NXinstrument">
|
|
<xs:complexType>
|
|
<xs:sequence minOccurs="0">
|
|
<xs:element ref="NXinsertion_device"/>
|
|
<xs:element ref="NXsource"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="NXinsertion_device">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="type" type="commonElement"/>
|
|
<xs:element name="energy" type="commonElement"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="NXsource">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="name" type="commonElement"/>
|
|
<xs:element name="type" type="commonElement"/>
|
|
<xs:element name="probe" type="commonElement"/>
|
|
<xs:element name="current" type="commonElement"/>
|
|
<xs:element name="top_up" type="commonElement"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<xs:element name="NXcollection">
|
|
<xs:complexType>
|
|
<xs:sequence>
|
|
<xs:element name="beamline" type="commonElement"/>
|
|
</xs:sequence>
|
|
<xs:attribute name="name" type="type_NeXus_name" />
|
|
</xs:complexType>
|
|
</xs:element>
|
|
|
|
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
|
<xs:complexType name="commonElement" mixed="true">
|
|
<xs:group ref="Attr_group"/>
|
|
<xs:attributeGroup ref="common_attributes"/>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="dataElement" mixed="true">
|
|
<xs:group ref="Attr_group"/>
|
|
<xs:attributeGroup ref="data_attributes"/>
|
|
</xs:complexType>
|
|
|
|
<xs:attributeGroup name="common_attributes">
|
|
<xs:attribute name="name" type="type_NeXus_name"/>
|
|
<xs:attribute name="outtype" type="type_outtype"/>
|
|
<xs:attribute name="source" type="type_source"/>
|
|
<xs:attribute name="type" type="type_basic_values"/>
|
|
</xs:attributeGroup>
|
|
|
|
<xs:attributeGroup name="data_attributes">
|
|
<xs:attribute name="name" type="type_NeXus_name"/>
|
|
<xs:attribute name="outtype" type="type_outtype"/>
|
|
<xs:attribute name="source" type="type_source"/>
|
|
<xs:attribute name="type" type="type_basic_values_and_pArray"/>
|
|
</xs:attributeGroup>
|
|
|
|
<xs:group name="Attr_group">
|
|
<xs:sequence>
|
|
<xs:element name="Attr" minOccurs="0" maxOccurs="unbounded">
|
|
<xs:complexType mixed="true">
|
|
<xs:attributeGroup ref="common_attributes"/>
|
|
</xs:complexType>
|
|
</xs:element>
|
|
</xs:sequence>
|
|
</xs:group>
|
|
|
|
<!-- There are only two kinds values allowed for the "type" attribute -->
|
|
|
|
<xs:simpleType name="type_basic_values_and_pArray">
|
|
<xs:union memberTypes="type_pArray type_ATTR type_CONST type_ND_ATTR"/>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="type_basic_values">
|
|
<xs:union memberTypes="type_ATTR type_CONST type_ND_ATTR"/>
|
|
</xs:simpleType>
|
|
|
|
<!-- These definitions look simplistic, here's why:
|
|
Define each term here with the text appearing only once,
|
|
then every instance using the definition can be validated
|
|
for correct spelling.
|
|
-->
|
|
<xs:simpleType name="type_pArray">
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="pArray"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="type_ATTR">
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="ATTR"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="type_CONST">
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="CONST"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="type_ND_ATTR">
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="ND_ATTR"/>
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="type_source">
|
|
<!-- must match rule for "name" attribute in attributes.xsd -->
|
|
<xs:restriction base="xs:token">
|
|
<xs:pattern value="[A-Za-z_][\w_]*" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="type_outtype">
|
|
<xs:list itemType="xs:string"/>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="type_NeXus_name">
|
|
<xs:restriction base="xs:token">
|
|
<xs:pattern value="[A-Za-z_][\w_]*" /> <!-- NeXus restrictions to HDF5 naming rule -->
|
|
<xs:maxLength value="63" /> <!-- HDF5 rule -->
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
</xs:schema>
|