source: trunk/nxdlTypes.xsd @ 1089

Revision 1060, 11.1 KB checked in by Pete Jemian, 3 months ago (diff)

fixes #216 (updated copyrights to 2012, renamed all to NIAC ownership

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author HeadURL Id
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3########### SVN repository information ###################
4# $LastChangedDate$
5# $LastChangedBy$
6# $LastChangedRevision$
7# $HeadURL$
8########### SVN repository information ###################
9-->
10
11<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
12        targetNamespace="http://definition.nexusformat.org/nxdl/@NXDL_RELEASE@"
13        xmlns:nxdl="http://definition.nexusformat.org/nxdl/@NXDL_RELEASE@" 
14        version="$Id$"
15        elementFormDefault="qualified">
16
17        <xs:annotation>
18                <xs:documentation>
19                        # NeXus - Neutron and X-ray Common Data Format
20                        #
21                        # Copyright (C) 2008-2012 NeXus International Advisory Committee (NIAC)
22                        #
23                        # This library is free software; you can redistribute it and/or
24                        # modify it under the terms of the GNU Lesser General Public
25                        # License as published by the Free Software Foundation; either
26                        # version 3 of the License, or (at your option) any later version.
27                        #
28                        # This library is distributed in the hope that it will be useful,
29                        # but WITHOUT ANY WARRANTY; without even the implied warranty of
30                        # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
31                        # Lesser General Public License for more details.
32                        #
33                        # You should have received a copy of the GNU Lesser General Public
34                        # License along with this library; if not, write to the Free Software
35                        # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
36                        #
37                        # For further information, see http://www.nexusformat.org
38                </xs:documentation>
39        </xs:annotation>
40   
41    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
42
43        <xs:simpleType name="anyUnitsAttr">
44                <xs:annotation>
45                        <xs:documentation>
46                                Unit categories in NXDL specifications
47                                describe the expected type of units for a NeXus field.
48                                They should describe valid units consistent with
49                                the manual section on NeXus units (based on UDUNITS).
50                                Units are not validated by NeXus.
51                        </xs:documentation>
52                </xs:annotation>
53                <xs:restriction base="xs:string">
54                        <xs:enumeration value="NX_ANGLE"><xs:annotation><xs:documentation>example: degrees or radians or arcminutes or</xs:documentation></xs:annotation></xs:enumeration>
55                        <xs:enumeration value="NX_ANY"><xs:annotation><xs:documentation>usage: things like logs that aren't picky on units</xs:documentation></xs:annotation></xs:enumeration>
56                    <xs:enumeration value="NX_AREA"><xs:annotation><xs:documentation>example: m2 or barns</xs:documentation></xs:annotation></xs:enumeration>
57                        <xs:enumeration value="NX_CROSS_SECTION"><xs:annotation><xs:documentation>example: barns</xs:documentation></xs:annotation></xs:enumeration>
58                        <xs:enumeration value="NX_CHARGE"><xs:annotation><xs:documentation>example: pC or C</xs:documentation></xs:annotation></xs:enumeration>
59                        <xs:enumeration value="NX_CURRENT"><xs:annotation><xs:documentation>example: A</xs:documentation></xs:annotation></xs:enumeration>
60                        <xs:enumeration value="NX_DIMENSIONLESS"><xs:annotation><xs:documentation>for fields where the units cancel out, example: "" or mm/mm (NOTE: not the same as NX_UNITLESS)</xs:documentation></xs:annotation></xs:enumeration>
61                        <xs:enumeration value="NX_EMITTANCE"><xs:annotation><xs:documentation>emittance (length * angle) of a radiation source, example: nm*rad</xs:documentation></xs:annotation></xs:enumeration>
62                        <xs:enumeration value="NX_ENERGY"><xs:annotation><xs:documentation>example: J or keV</xs:documentation></xs:annotation></xs:enumeration>
63                        <xs:enumeration value="NX_FLUX"><xs:annotation><xs:documentation>example: s-1 cm-2</xs:documentation></xs:annotation></xs:enumeration>
64                        <xs:enumeration value="NX_FREQUENCY"><xs:annotation><xs:documentation>example: Hz</xs:documentation></xs:annotation></xs:enumeration>
65                        <xs:enumeration value="NX_LENGTH"><xs:annotation><xs:documentation>example: m</xs:documentation></xs:annotation></xs:enumeration>
66                        <xs:enumeration value="NX_MASS"><xs:annotation><xs:documentation>example: g</xs:documentation></xs:annotation></xs:enumeration>
67                        <xs:enumeration value="NX_MASS_DENSITY"><xs:annotation><xs:documentation>example: g cm-3</xs:documentation></xs:annotation></xs:enumeration>
68                        <xs:enumeration value="NX_MOLECULAR_WEIGHT"><xs:annotation><xs:documentation>example: g mol-1</xs:documentation></xs:annotation></xs:enumeration>
69                        <xs:enumeration value="NX_PER_AREA"><xs:annotation><xs:documentation>example: cm-2</xs:documentation></xs:annotation></xs:enumeration>
70                        <xs:enumeration value="NX_PER_LENGTH"><xs:annotation><xs:documentation>example: cm-1</xs:documentation></xs:annotation></xs:enumeration>
71                        <xs:enumeration value="NX_PERIOD"><xs:annotation><xs:documentation>(alias to NX_TIME) period of pulsed source, example: microseconds</xs:documentation></xs:annotation></xs:enumeration>
72                        <xs:enumeration value="NX_POWER"><xs:annotation><xs:documentation>example: W</xs:documentation></xs:annotation></xs:enumeration>
73                        <xs:enumeration value="NX_PRESSURE"><xs:annotation><xs:documentation>example: Pa</xs:documentation></xs:annotation></xs:enumeration>
74                        <xs:enumeration value="NX_PULSES"><xs:annotation><xs:documentation>(alias to NX_NUMBER) clock pulses</xs:documentation></xs:annotation></xs:enumeration>
75                        <xs:enumeration value="NX_SCATTERING_LENGTH_DENSITY"><xs:annotation><xs:documentation>example: cm-2</xs:documentation></xs:annotation></xs:enumeration>
76                        <xs:enumeration value="NX_SOLID_ANGLE"><xs:annotation><xs:documentation>example: sr | steradian</xs:documentation></xs:annotation></xs:enumeration>
77                        <xs:enumeration value="NX_TEMPERATURE"><xs:annotation><xs:documentation>example: K</xs:documentation></xs:annotation></xs:enumeration>
78                        <xs:enumeration value="NX_TIME"><xs:annotation><xs:documentation>example: s</xs:documentation></xs:annotation></xs:enumeration>
79                    <xs:enumeration value="NX_TIME_OF_FLIGHT"><xs:annotation><xs:documentation>(alias to NX_TIME) example: s</xs:documentation></xs:annotation></xs:enumeration>
80                    <xs:enumeration value="NX_VOLTAGE"><xs:annotation><xs:documentation>example: V</xs:documentation></xs:annotation></xs:enumeration>
81                    <xs:enumeration value="NX_VOLUME"><xs:annotation><xs:documentation>example: m3</xs:documentation></xs:annotation></xs:enumeration>
82                        <xs:enumeration value="NX_UNITLESS"><xs:annotation><xs:documentation>for fields that don't have a unit (e.g. hkl) so that they don't inherit the wrong units (NOTE: not the same as NX_DIMENSIONLESS)</xs:documentation></xs:annotation></xs:enumeration>
83                    <xs:enumeration value="NX_WAVELENGTH"><xs:annotation><xs:documentation>example: Angstrom</xs:documentation></xs:annotation></xs:enumeration>
84                        <xs:enumeration value="NX_WAVENUMBER"><xs:annotation><xs:documentation>units for Q, example: Angstrom-1 or nm-1</xs:documentation></xs:annotation></xs:enumeration>
85                </xs:restriction>
86        </xs:simpleType>
87   
88    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
89
90        <xs:simpleType name="primitiveType">
91                <xs:annotation>
92                        <xs:documentation>
93                                Valid names for the type attribute on fields and attributes.
94                                This is an alias for NAPI (which is any valid NeXus type).
95                        </xs:documentation>
96                </xs:annotation>
97                <xs:list itemType="nxdl:NAPI" />
98        </xs:simpleType>
99       
100        <xs:simpleType name="NAPI">
101                <xs:annotation>
102                        <xs:documentation>any valid NeXus type</xs:documentation>
103                </xs:annotation>
104                <xs:restriction base="xs:string">
105                        <xs:enumeration value="NX_CHAR"><xs:annotation><xs:documentation>a string</xs:documentation></xs:annotation></xs:enumeration>
106                        <xs:enumeration value="NX_FLOAT"><xs:annotation><xs:documentation>any floating point number or array thereof</xs:documentation></xs:annotation></xs:enumeration>
107                        <xs:enumeration value="NX_INT"><xs:annotation><xs:documentation>any integer or array thereof</xs:documentation></xs:annotation></xs:enumeration>
108                        <xs:enumeration value="NX_UINT"><xs:annotation><xs:documentation>any unsigned integer (including zero) or array thereof</xs:documentation></xs:annotation></xs:enumeration>
109                        <xs:enumeration value="NX_POSINT"><xs:annotation><xs:documentation>any positive (non-zero) integer or array thereof</xs:documentation></xs:annotation></xs:enumeration>
110                        <xs:enumeration value="NX_NUMBER"><xs:annotation><xs:documentation>any integer or float number or array thereof</xs:documentation></xs:annotation></xs:enumeration>
111                        <xs:enumeration value="NX_DATE_TIME"><xs:annotation><xs:documentation>alias of ISO8601</xs:documentation></xs:annotation></xs:enumeration>
112                        <xs:enumeration value="ISO8601"><xs:annotation><xs:documentation>ISO 8601 date and time representation</xs:documentation></xs:annotation></xs:enumeration>
113                        <xs:enumeration value="NX_BOOLEAN"><xs:annotation><xs:documentation>boolean</xs:documentation></xs:annotation></xs:enumeration>
114                        <xs:enumeration value="NX_BINARY"><xs:annotation><xs:documentation>any representation of binary data - if text, line terminator is [CR][LF]</xs:documentation></xs:annotation></xs:enumeration>
115                </xs:restriction>
116        </xs:simpleType>
117   
118    <xs:simpleType name="NX_CHAR">
119                <xs:annotation>
120                        <xs:documentation>any string representation</xs:documentation>
121                </xs:annotation>
122                <xs:restriction base="xs:string" />
123        </xs:simpleType>
124       
125        <xs:simpleType name="NX_FLOAT">
126                <xs:annotation>
127                        <xs:documentation>any representation of a floating point number</xs:documentation>
128                </xs:annotation>
129                <xs:restriction base="xs:float" />
130        </xs:simpleType>
131       
132        <xs:simpleType name="NX_INT">
133                <xs:annotation>
134                        <xs:documentation>any representation of an integer number</xs:documentation>
135                </xs:annotation>
136                <xs:restriction base="xs:integer" />
137        </xs:simpleType>
138       
139        <xs:simpleType name="NX_UINT">
140                <xs:annotation>
141                        <xs:documentation>any representation of an unsigned integer number (includes zero)</xs:documentation>
142                </xs:annotation>
143                <xs:restriction base="xs:unsignedInt" />
144        </xs:simpleType>
145       
146        <xs:simpleType name="NX_POSINT">
147                <xs:annotation>
148                        <xs:documentation>any representation of a positive integer number (greater than zero)</xs:documentation>
149                </xs:annotation>
150                <xs:restriction base="xs:positiveInteger" />
151        </xs:simpleType>
152       
153        <xs:simpleType name="NX_NUMBER">
154                <xs:annotation>
155                        <xs:documentation>any valid NeXus number representation</xs:documentation>
156                </xs:annotation>
157                <xs:union memberTypes="nxdl:NX_INT nxdl:NX_UINT nxdl:NX_POSINT nxdl:NX_FLOAT"></xs:union>
158        </xs:simpleType>
159       
160        <xs:simpleType name="NX_DATE_TIME">
161                <xs:annotation>
162                        <xs:documentation>alias for the ISO8601 date/time stamp</xs:documentation>
163                </xs:annotation>
164                <xs:restriction base="nxdl:ISO8601" />
165        </xs:simpleType>
166       
167        <xs:simpleType name="ISO8601">
168                <xs:annotation>
169                        <xs:documentation>ISO8601 date/time stamp</xs:documentation>
170                </xs:annotation>
171                <xs:restriction base="xs:dateTime" />
172        </xs:simpleType>
173       
174        <xs:simpleType name="NX_BOOLEAN">
175                <xs:annotation>
176                        <xs:documentation>true/false value ( true | 1 | false | 0 )</xs:documentation>
177                </xs:annotation>
178                <xs:restriction base="xs:boolean" />
179        </xs:simpleType>
180       
181        <xs:simpleType name="NX_BINARY">
182                <xs:annotation>
183                        <xs:documentation>any representation of binary data - if text, line terminator is [CR][LF]</xs:documentation>
184                </xs:annotation>
185                <!-- TODO Is this the way to describe pure binary?  uint8, byte, hex64binary -->
186                <!-- TODO Should be a uint8 but this does not seem to be allowed.  Using xs:unsignedByte instead. -->
187                <xs:restriction base="xs:unsignedByte" />
188        </xs:simpleType>
189
190</xs:schema>
Note: See TracBrowser for help on using the repository browser.