source: trunk/nxdl.xsd @ 1089

Revision 1060, 49.7 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:nx="http://definition.nexusformat.org/nxdl/@NXDL_RELEASE@" 
14        version="$Id$"
15        xmlns:db="http://docbook.org/ns/docbook"
16        elementFormDefault="qualified">
17
18        <xs:annotation>
19                <xs:documentation>
20                        # NeXus - Neutron and X-ray Common Data Format
21                        #
22                        # Copyright (C) 2008-2012 NeXus International Advisory Committee (NIAC)
23                        #
24                        # This library is free software; you can redistribute it and/or
25                        # modify it under the terms of the GNU Lesser General Public
26                        # License as published by the Free Software Foundation; either
27                        # version 3 of the License, or (at your option) any later version.
28                        #
29                        # This library is distributed in the hope that it will be useful,
30                        # but WITHOUT ANY WARRANTY; without even the implied warranty of
31                        # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
32                        # Lesser General Public License for more details.
33                        #
34                        # You should have received a copy of the GNU Lesser General Public
35                        # License along with this library; if not, write to the Free Software
36                        # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37                        #
38                        # For further information, see http://www.nexusformat.org
39                </xs:documentation>
40        </xs:annotation>
41       
42        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
43       
44        <xs:include schemaLocation="nxdlTypes.xsd">
45                <xs:annotation>
46                        <xs:documentation>
47                                Definitions of the basic data types and unit types
48                                allowed in NXDL instance files.
49                        </xs:documentation>
50                </xs:annotation>
51        </xs:include>
52       
53        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
54       
55        <!-- define the document root element -->
56        <xs:element name="definition" type="nx:definitionType">
57                <xs:annotation>
58                        <xs:documentation>
59                                A <db:code>definition</db:code> element
60                                is the <db:code>group</db:code> at the
61                                root of every NXDL specification.
62                                It may <db:emphasis>only</db:emphasis> appear
63                                at the root of an NXDL file and must only appear
64                                <db:emphasis role="bold">once</db:emphasis>
65                                for the NXDL to be <db:emphasis>well-formed</db:emphasis>.
66                        </xs:documentation>
67                </xs:annotation>
68        </xs:element>
69       
70        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
71       
72        <xs:simpleType name="validItemName">
73                <xs:annotation>
74                        <xs:documentation>
75                                Used for allowed names of elements and attributes. 
76                                Need to be restricted to valid program variable names. 
77                                Note:  This means no "-" or "." characters can be allowed and
78                                you cannot start with a number.
79                                HDF4 had a 64 character limit on names
80                                (possibly including NULL) and NeXus enforces this
81                                via the <db:code>NX_MAXNAMELEN</db:code> variable with
82                                a <db:emphasis role="bold">64</db:emphasis> character limit (which
83                                may be 63 on a practical basis if one considers a NULL
84                                terminating byte).
85                                (This data type is used internally in the NXDL schema
86                                to define a data type.)
87                        </xs:documentation> 
88                </xs:annotation> 
89                <xs:restriction base="xs:token">
90                        <xs:pattern value="[A-Za-z_][\w_]*" />
91                        <xs:maxLength value="63" />   <!-- enforce via NX_MAXNAMELEN -->
92                </xs:restriction>
93        </xs:simpleType>
94       
95        <xs:simpleType name="validNXClassName">
96                <xs:annotation>
97                        <xs:documentation>
98                          Used for allowed names of NX class types (e.g. NXdetector)
99                          not the instance (e.g. bank1) which is covered by validItemName. 
100                          (This data type is used internally in the NXDL schema
101                          to define a data type.)
102                        </xs:documentation> 
103                </xs:annotation> 
104                <xs:restriction base="nx:validItemName">
105                        <xs:pattern value="NX.+"/>
106                </xs:restriction>
107        </xs:simpleType>
108       
109        <xs:simpleType name="validTargetName">
110                <xs:annotation>
111                        <xs:documentation>
112                                This is a valid link target - currently it must be an absolute path
113                                made up of valid names with the <db:code>/</db:code> character delimiter.  But we may
114                                want to consider allowing "<db:code>..</db:code>" (parent of directory) at some point.
115                                If the <db:code>name</db:code> attribute is helpful, then use it in the path
116                                with the syntax of "<db:code>name:type</db:code>" as in these examples:
117                                <db:programlisting language="c"
118>/NXentry/NXinstrument/analyzer:NXcrystal/ef
119/NXentry/NXinstrument/monochromator:NXcrystal/ei
120/NX_other</db:programlisting>
121                                Must also consider use of <db:code>name</db:code> attribute in resolving <db:code>link</db:code> targets.
122                                (This data type is used internally in the NXDL schema
123                                to define a data type.)
124                        </xs:documentation> 
125                </xs:annotation> 
126                <xs:restriction base="xs:token">
127                        <xs:annotation>
128                                <xs:documentation>
129                                        The HDF5 documentation
130                                        (<db:uri>http://www.hdfgroup.org/HDF5/doc/UG/UG_frame09Groups.html</db:uri>)
131                                        says "<db:quote>Note that relative path names in HDF5 do not employ the ../ notation,
132                                        the UNIX notation indicating a parent directory, to indicate a parent group.</db:quote>"
133                                        Thus, if we only consider the case of
134                                        <db:code>[name:]type</db:code>, the matching regular expression syntax
135                                        is written: <db:code>/[a-zA-Z_][\w_]*(:[a-zA-Z_][\w_]*)?)+</db:code>.
136                                        Note that HDF5 also permits relative path names, such as:
137                                        <db:code>GroupA/GroupB/Dataset1</db:code>
138                                        but this is not permitted in the matching regular expression and not supported in NAPI.
139                                </xs:documentation>
140                        </xs:annotation>
141                        <xs:pattern value="(/[a-zA-Z_][\w_]*(:[a-zA-Z_][\w_]*)?)+" />
142                </xs:restriction>
143        </xs:simpleType>
144       
145        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
146
147        <xs:complexType name="definitionType">
148                <xs:annotation>
149                        <xs:documentation>
150                                A <db:code>definition</db:code> is the root element of every NXDL definition.
151                                The <db:code>definitionType</db:code> defines the documentation,
152                                attributes, fields, and groups that will be used
153                                as children of the <db:code>definition</db:code> element.
154                                Could contain these elements:
155                                <db:itemizedlist>
156                                        <db:listitem><db:para><db:code>attribute</db:code></db:para></db:listitem>
157                                        <db:listitem><db:para><db:code>doc</db:code></db:para></db:listitem>
158                                        <db:listitem><db:para><db:code>field</db:code></db:para></db:listitem>
159                                        <db:listitem><db:para><db:code>group</db:code></db:para></db:listitem>
160                                        <db:listitem><db:para><db:code>link</db:code></db:para></db:listitem>
161                                </db:itemizedlist>
162                                Note that a <db:code>definition</db:code> element also includes the definitions of the
163                                <db:code>basicComponent</db:code> data type.
164                                (The <db:code>definitionType</db:code> data type is used internally in the NXDL schema
165                                to define elements and attributes to be used by users in NXDL specifications.)
166                        </xs:documentation>
167                </xs:annotation>
168                <xs:sequence>
169                        <xs:element name="symbols" type="nx:symbolsType" minOccurs="0" maxOccurs="1">
170                                <xs:annotation>
171                                        <xs:documentation>
172                                                Use the <db:code>symbols</db:code> element to create a list of
173                                                <db:code>symbol</db:code>s to define each of the mnemonics that
174                                                represent the length of each dimension in a vector or array.
175                                        </xs:documentation>
176                                </xs:annotation>
177                        </xs:element>
178                        <xs:group ref="nx:groupGroup" minOccurs="0" maxOccurs="unbounded">
179                                <xs:annotation>
180                                        <xs:documentation>
181                                                In addition to an optional <db:code>symbols</db:code> list,
182                                                a <db:code>definition</db:code> may contain any of the items
183                                                allowed in a <db:code>group</db:code>.
184                                        </xs:documentation>
185                                </xs:annotation>
186                        </xs:group>
187                </xs:sequence>
188                <xs:attribute name="name" use="required" type="nx:validItemName">
189                        <xs:annotation>
190                                <xs:documentation>
191                                        (<db:emphasis role="bold">required</db:emphasis>)
192                                        The <db:code>name</db:code> of this NXDL file (without the file extensions).
193                                        The name must be unique amongst all the NeXus base class, application,
194                                        and contributed definitions.  For the class to be adopted by the NIAC,
195                                        the first two letters must be "<db:code>NX</db:code>" (in uppercase).  Any other use
196                                        must <db:emphasis>not</db:emphasis> begin with "<db:code>NX</db:code>" in any combination
197                                        of upper or lower case.
198                                </xs:documentation>
199                        </xs:annotation>
200                </xs:attribute>
201                <xs:attribute name="version" use="required">
202                        <xs:annotation>
203                                <xs:documentation>
204                                        (<db:emphasis role="bold">required</db:emphasis>)
205                                        Version of <db:emphasis>this</db:emphasis> NXDL definition. 
206                                        Each NXDL specification
207                                        may have a different version to facilitate software maintenance.
208                                        This value is modified by the person who edits this file when
209                                        this NXDL specification has changed significantly (in a way that
210                                        downstream software should be aware).
211                                </xs:documentation>
212                        </xs:annotation>
213                </xs:attribute>
214                <xs:attribute name="type" use="required" type="nx:definitionTypeAttr">
215                        <xs:annotation>
216                                <xs:documentation>
217                                        (<db:emphasis role="bold">required</db:emphasis>)
218                                        Must be <db:code>type="group"</db:code>
219                                </xs:documentation>
220                        </xs:annotation>
221                </xs:attribute>
222                <xs:attribute name="extends" use="optional">
223                        <xs:annotation>
224                                <xs:documentation>
225                                        The <db:code>extends</db:code> attribute allows this definition
226                                        to <db:emphasis>subclass</db:emphasis> from another NXDL,
227                                        otherwise <db:code>extends="NXobject"</db:code> should be used.
228                                </xs:documentation>
229                        </xs:annotation>
230                </xs:attribute>
231                <xs:attribute name="restricts" use="optional">
232                        <xs:annotation>
233                                <xs:documentation>
234                                        The <db:code>restricts</db:code> attribute is a flag to the data validation.
235                                        When <db:code>restricts="1"</db:code>, any non-standard component found
236                                        (and checked for validity aginst this NXDL specification)
237                                        in a NeXus data file will be flagged as an error.  If the
238                                        <db:code>restricts</db:code> attribute is not present, any such situations
239                                        will produce a warning.
240                                </xs:documentation>
241                        </xs:annotation>
242                </xs:attribute>
243                <xs:attribute name="svnid" use="optional">
244                        <xs:annotation>
245                                <xs:documentation>
246                                        The identifier string from the subversion revision control system.
247                                        This reports the time stamp and the revision number of this file.
248                                        (Updated automatically, unlike the <db:code>version</db:code> attribute.)
249                                </xs:documentation>
250                        </xs:annotation>
251                </xs:attribute>
252                <xs:attribute name="category" use="required">
253                        <xs:annotation>
254                                <xs:documentation>
255                                        NXDL <db:code>base</db:code> definitions define the dictionary
256                                        of terms to use for these components. 
257                                        All terms in a <db:code>base</db:code> definition are optional.
258                                        NXDL <db:code>application</db:code> definitions define what is
259                                        required for a scientific interest. 
260                                        All terms in an <db:code>application</db:code> definition
261                                        are required.
262                                        NXDL <db:code>contributed</db:code> definitions may be
263                                        considered either base or applications.
264                                        Contributed definitions <emphasis>must</emphasis> indicate
265                                        their intended use, either as a base class or
266                                        as an application definition.
267                                </xs:documentation>
268                        </xs:annotation>
269                        <xs:simpleType>
270                                <xs:restriction base="xs:string">
271                                        <xs:enumeration value="base"/>
272                                        <xs:enumeration value="application"/>
273                                        <xs:enumeration value="contributed"/>
274                                </xs:restriction>
275                        </xs:simpleType>
276                </xs:attribute>
277                <xs:attribute name="ignoreExtraGroups" use="optional" type="nx:NX_BOOLEAN" default="false">
278                        <xs:annotation>
279                                <xs:documentation>
280                                        Only validate known groups; do not not warn about unknowns.
281                                        The <db:code>ignoreExtraGroups</db:code> attribute is a flag to the process of
282                                        validating NeXus data files.  By setting <db:code>ignoreExtraGroups="true"</db:code>,
283                                        presence of any undefined groups in this class will not generate warnings
284                                        during validation.  Normally, validation will check all the groups against
285                                        their definition in the NeXus base classes and
286                                        application definitions.  Any items found that do not match the definition
287                                        in the NXDL will generate a warning message.
288                                        <db:emphasis>The <db:code>ignoreExtraGroups</db:code> attribute
289                                        should be used sparingly!</db:emphasis>
290                                </xs:documentation>
291                        </xs:annotation>
292                </xs:attribute>
293                <xs:attribute name="ignoreExtraFields" use="optional" type="nx:NX_BOOLEAN" default="false">
294                        <xs:annotation>
295                                <xs:documentation>
296                                        Only validate known fields; do not not warn about unknowns.
297                                        The <db:code>ignoreExtraFields</db:code> attribute is a flag to the process of
298                                        validating NeXus data files.  By setting <db:code>ignoreExtraFields="true"</db:code>,
299                                        presence of any undefined fields in this class will not generate warnings
300                                        during validation.  Normally, validation will check all the fields against
301                                        their definition in the NeXus base classes and
302                                        application definitions.  Any items found that do not match the definition
303                                        in the NXDL will generate a warning message.
304                                        <db:emphasis>The <db:code>ignoreExtraFields</db:code> attribute should be used sparingly!</db:emphasis>
305                                </xs:documentation>
306                        </xs:annotation>
307                </xs:attribute>
308                <xs:attribute name="ignoreExtraAttributes" use="optional" type="nx:NX_BOOLEAN" default="false">
309                        <xs:annotation>
310                                <xs:documentation>
311                                        Only validate known attributes; do not not warn about unknowns.
312                                        The <db:code>ignoreExtraAttributes</db:code> attribute is a flag to the process of
313                                        validating NeXus data files.  By setting <db:code>ignoreExtraAttributes="true"</db:code>,
314                                        presence of any undefined attributes in this class will not generate warnings
315                                        during validation.  Normally, validation will check all the attributes
316                                        against their definition in the NeXus base classes and
317                                        application definitions.  Any items found that do not match the definition
318                                        in the NXDL will generate a warning message.
319                                        <db:emphasis>The <db:code>ignoreExtraAttributes</db:code> attribute should be used sparingly!</db:emphasis>
320                                </xs:documentation>
321                        </xs:annotation>
322                </xs:attribute>
323        </xs:complexType>
324       
325        <xs:simpleType name="definitionTypeAttr">
326                <xs:annotation>
327                        <xs:documentation>
328                                Prescribes the allowed values for <db:code>definition</db:code> <db:code>type</db:code> attribute.
329                                (This data type is used internally in the NXDL schema
330                                to define a data type.)
331                        </xs:documentation>
332                </xs:annotation>
333                <xs:restriction base="xs:string">
334                        <xs:enumeration value="group" />
335                        <xs:enumeration value="definition" />
336                </xs:restriction>
337        </xs:simpleType>
338       
339        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
340       
341        <xs:complexType name="groupType">
342                <xs:annotation>
343                        <xs:documentation>
344                                A group element refers to the definition of
345                                an existing NX object or a locally-defined component.
346                                Could contain these elements:
347                                <db:itemizedlist>
348                                        <db:listitem><db:para><db:code>attribute</db:code></db:para></db:listitem>
349                                        <db:listitem><db:para><db:code>doc</db:code></db:para></db:listitem>
350                                        <db:listitem><db:para><db:code>field</db:code></db:para></db:listitem>
351                                        <db:listitem><db:para><db:code>group</db:code></db:para></db:listitem>
352                                        <db:listitem><db:para><db:code>link</db:code></db:para></db:listitem>
353                                </db:itemizedlist>
354                                Note that a <db:code>group</db:code> element also includes the definitions of the
355                                <db:code>basicComponent</db:code> data type.
356                                (The <db:code>groupType</db:code> data type is used internally in the NXDL schema
357                                to define elements and attributes to be used by users in NXDL specifications.)
358                        </xs:documentation>
359                </xs:annotation>
360                <xs:group ref="nx:groupGroup" minOccurs="0" maxOccurs="unbounded">
361                        <xs:annotation>
362                                <xs:documentation>
363                                        A <db:code>group</db:code> may contain other <db:code>group</db:code>s.
364                                </xs:documentation>
365                        </xs:annotation>
366                </xs:group>
367                <xs:attribute name="type" use="required" type="nx:validNXClassName">
368                        <xs:annotation>
369                                <xs:documentation>
370                                        The <db:code>type</db:code> attribute <db:emphasis>must</db:emphasis> 
371                                        contain the name of a
372                                        NeXus base class, application definition, or contributed definition.
373                                </xs:documentation>
374                        </xs:annotation>
375                </xs:attribute>
376                <xs:attribute name="name" use="optional" type="nx:validItemName">
377                        <xs:annotation>
378                                <xs:documentation>
379                                        A particular scientific application may expect
380                                        a name of a <db:code>group</db:code> element. It is helpful but not
381                                        required to specify the <db:code>name</db:code>
382                                        attribute in the NXDL file.
383                                        It is suggested to always specify a <db:code>name</db:code>
384                                        to avoid ambiguity.  It is also suggested to
385                                        derive the <db:code>name</db:code> from the
386                                        type, using an additional number suffix as necessary.
387                                        For example, consider a data file with only one
388                                        <db:code>NXentry</db:code>.  The suggested default
389                                        <db:code>name</db:code> would
390                                        be <db:code>entry</db:code>.  For a data file with two or more
391                                        <db:code>NXentry</db:code> groups, the suggested names would be
392                                        <db:code>entry1</db:code>, <db:code>entry2</db:code>, ...
393                                        Alternatively, a scientific application such as small-angle
394                                        scattering might require
395                                        a different naming procedure; two different <db:code>NXaperture</db:code> groups
396                                        might be given the names <db:code>beam-defining slit</db:code>
397                                        and <db:code>scatter slit</db:code>.
398                                </xs:documentation>
399                        </xs:annotation>
400                </xs:attribute>
401                <xs:attribute name="minOccurs" use="optional" default="0" type="xs:nonNegativeInteger">
402                        <xs:annotation>
403                                <xs:documentation>
404                                        Minimum number of times this <db:code>group</db:code> is allowed to be present within its
405                                        parent group.  Note each <db:code>group</db:code> must have a <db:code>name</db:code> attribute
406                                        that is unique among all <db:code>group</db:code> and <db:code>field</db:code>
407                                        declarations within a common parent group.
408                                </xs:documentation>
409                        </xs:annotation>
410                </xs:attribute>
411                <xs:attribute name="maxOccurs" use="optional"  default="unbounded">
412                        <xs:annotation>
413                                <xs:documentation>
414                                        Maximum number of times this <db:code>group</db:code> is allowed to be present within its
415                                        parent <db:code>group</db:code>.  Note each <db:code>group</db:code> must have a <db:code>name</db:code> attribute
416                                        that is unique among all <db:code>group</db:code> and <db:code>field</db:code>
417                                        declarations within a common parent <db:code>group</db:code>.
418                                </xs:documentation>
419                        </xs:annotation>
420                </xs:attribute>
421        </xs:complexType>
422
423        <xs:group name="groupGroup">
424                <xs:annotation>
425                        <xs:documentation>
426                                A <db:code>groupGroup</db:code> defines the allowed children of a
427                                <db:code>group</db:code> specification.
428                        </xs:documentation>
429                </xs:annotation>
430                <xs:sequence>
431                        <xs:element name="doc" type="nx:docType" minOccurs="0" maxOccurs="1">
432                                <xs:annotation>
433                                        <xs:documentation>
434                                                Describe the purpose of this <db:code>group</db:code>.
435                                                This documentation will go into the manual.
436                                        </xs:documentation>
437                                </xs:annotation>
438                        </xs:element>
439                        <xs:element name="attribute" type="nx:attributeType" minOccurs="0" maxOccurs="unbounded">
440                                <xs:annotation>
441                                        <xs:documentation>
442                                                Use an <db:code>attribute</db:code> if additional information
443                                                needs to be associated with a <db:code>group</db:code>.
444                                        </xs:documentation>
445                                </xs:annotation>
446                        </xs:element>
447                        <xs:element name="group" type="nx:groupType" minOccurs="0" maxOccurs="unbounded">
448                                <xs:annotation>
449                                        <xs:documentation>
450                                                A <db:code>group</db:code> may contain <db:code>group</db:code>s.
451                                        </xs:documentation>
452                                </xs:annotation>
453                        </xs:element>
454                        <xs:element name="field" type="nx:fieldType" minOccurs="0" maxOccurs="unbounded">
455                                <xs:annotation>
456                                        <xs:documentation>
457                                                A <db:code>group</db:code> may contain <db:code>field</db:code>s (datasets).
458                                        </xs:documentation>
459                                </xs:annotation>
460                        </xs:element>
461                        <xs:element name="link" type="nx:linkType" minOccurs="0" maxOccurs="unbounded">
462                                <xs:annotation>
463                                        <xs:documentation>
464                                                Use a <db:code>link</db:code> to refer locally to
465                                                information placed elsewhere else in the data storage hierarchy. 
466                                                The <db:code>name</db:code> attribute uniquely identifies
467                                                the element in this <db:code>group</db:code>.
468                                                The <db:code>target</db:code> attribute
469                                                (added automatically in a data file by the NAPI)
470                                                identifies the original location of this data in the
471                                                data storage hierarchy.
472                                                In an NXDL specification, the <db:code>target</db:code> attribute
473                                                indicates a link to be made by the software that writes the data file.
474                                                The value, as written in the NXDL file, will be a suggestion of
475                                                the path to the source of the link.
476                                                For example:
477                                                <db:programlisting language="xml"
478                                                        >&lt;link name="data" target="/NXentry/NXinstrument/NXdetector/data" /&gt;</db:programlisting>
479                                                The value of <db:code>target</db:code> is written using
480                                                the NeXus class names since this is a suggestion and does not actually use
481                                                the element names from a particular data file.
482                                        </xs:documentation>
483                                </xs:annotation>
484                        </xs:element>
485                </xs:sequence>
486        </xs:group>
487
488        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
489
490        <xs:complexType name="basicComponent">
491                        <xs:annotation>
492                                <xs:documentation>
493                                        A <db:code>basicComponent</db:code> defines the allowed name
494                                        format and attributes common to all <db:code>field</db:code> 
495                                        and <db:code>group</db:code> specifications.
496                                        (This data type is used internally in the NXDL schema
497                                        to define elements and attributes to be used by users in NXDL specifications.)
498                                </xs:documentation>
499                        </xs:annotation>
500                <xs:sequence>
501                        <xs:element name="doc" type="nx:docType" minOccurs="0" maxOccurs="1">
502                                <xs:annotation>
503                                        <xs:documentation>
504                                                Describe this <db:code>basicComponent</db:code> and its use.
505                                                This documentation will go into the manual.
506                                        </xs:documentation>
507                                </xs:annotation>
508                        </xs:element>
509                </xs:sequence>
510                <xs:attribute name="name" use="required" type="nx:validItemName">
511                        <xs:annotation>
512                                <xs:documentation>
513                                        The <db:code>name</db:code> attribute is the
514                                        identifier string for this entity.
515                                        It is required that <db:code>name</db:code> must be unique
516                                        within the enclosing <db:code>group</db:code>.
517                                        The rule (<db:code>validItemName</db:code>) is defined to only
518                                        allow names that can be represented as valid variable names
519                                        in most computer languages.
520                                </xs:documentation>
521                        </xs:annotation>
522                </xs:attribute>
523                <xs:attribute name="deprecated" use="optional">
524                        <xs:annotation>
525                                <xs:documentation>
526                                        The presence of the <db:code>deprecated</db:code> attribute
527                                        indicates to the data file validation process that
528                                        an advisory message (specified as the content of the
529                                        <db:code>deprecated</db:code> attribute) will be reported. 
530                                        Future versions of the NXDL file might
531                                        not define (or even re-use) this component.
532                                        For example:
533                                        <db:programlisting language="c">deprecated="Should the 'deprecated' attribute become a 'field' in a future version?"</db:programlisting>
534                                        Note: because <db:code>deprecated</db:code> is an attribute,
535                                        the XML rules do not permit it to have any element content
536                                        such as DocBook markup.
537                                </xs:documentation>
538                        </xs:annotation>
539                        <xs:simpleType>
540                                <xs:restriction base="xs:string">
541                                        <xs:pattern value=".*(\w+).*" />
542                                </xs:restriction>
543                        </xs:simpleType>
544                </xs:attribute>
545        </xs:complexType>
546
547        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
548               
549        <xs:complexType name="fieldType">
550                <xs:annotation>
551                        <xs:documentation>
552                                A <db:code>field</db:code> declares a new element in the component being defined.
553                                A <db:code>field</db:code> is synonymous with the HDF4 SDS (Scientific Data Set) and
554                                the HDF5 <db:emphasis>dataset</db:emphasis> terms. 
555                                Could contain these elements:
556                                <db:itemizedlist>
557                                        <db:listitem><db:para><db:code>attribute</db:code></db:para></db:listitem>
558                                        <db:listitem><db:para><db:code>dimensions</db:code></db:para></db:listitem>
559                                        <db:listitem><db:para><db:code>doc</db:code></db:para></db:listitem>
560                                        <db:listitem><db:para><db:code>enumeration</db:code></db:para></db:listitem>
561                                </db:itemizedlist>
562                                Note that a <db:code>field</db:code> element also includes the definitions of the
563                                <db:code>basicComponent</db:code> data type.
564                                (The <db:code>fieldType</db:code> data type is used internally in the NXDL schema
565                                to define elements and attributes to be used by users in NXDL specifications.)
566                        </xs:documentation>
567                </xs:annotation>
568                <xs:complexContent>
569                        <xs:extension base="nx:basicComponent">
570                                <xs:sequence>
571                                        <xs:element name="dimensions" type="nx:dimensionsType" minOccurs="0" maxOccurs="1">
572                                                <xs:annotation>
573                                                        <xs:documentation>dimensions of a data element
574                                                        in a NeXus file</xs:documentation>
575                                                </xs:annotation>
576                                        </xs:element>
577                                        <xs:element name="attribute" type="nx:attributeType" minOccurs="0" maxOccurs="unbounded">
578                                                <xs:annotation>
579                                                        <xs:documentation
580                                                        >attributes to be used with this field</xs:documentation>
581                                                </xs:annotation>
582                                        </xs:element>
583                                        <xs:element name="enumeration" type="nx:enumerationType" minOccurs="0">
584                                                <xs:annotation>
585                                                        <xs:documentation>A field can specify which
586                                                        values are to be used</xs:documentation>
587                                                </xs:annotation>
588                                        </xs:element>
589                                </xs:sequence>
590                                <xs:attribute name="units" type="nx:anyUnitsAttr">
591                                        <xs:annotation>
592                                                <xs:documentation>
593                                                        String describing the engineering units.
594                                                        The string should be appropriate for the value
595                                                        and should conform to the NeXus rules for units.
596                                                        Conformance is not validated at this time.
597                                                </xs:documentation>
598                                        </xs:annotation>
599                                </xs:attribute>
600                                <xs:attribute name="long_name" type="nx:NX_CHAR">
601                                        <xs:annotation>
602                                                <xs:documentation>
603                                                        Descriptive name for this field (may include whitespace and engineering units).
604                                                        Often, the long_name (when defined) will be used as the axis label on a plot.
605                                                </xs:documentation>
606                                        </xs:annotation>
607                                </xs:attribute>
608                                <xs:attribute name="signal" type="nx:NX_POSINT">
609                                        <xs:annotation>
610                                                <xs:documentation>
611                                                        Presence of the <db:code>signal</db:code> attribute means this field is an ordinate.
612                                                       
613                                                        Integer marking this field as plottable data (ordinates).
614                                                        The value indicates the priority of selection or interest.
615                                                        Some facilities only use <db:code>signal="1"</db:code>
616                                                        while others use <db:code>signal="2"</db:code> to indicate
617                                                        plottable data of secondary interest.
618                                                        Higher numbers are possible but not common
619                                                        and interpretation is not standard.
620                                                       
621                                                        A field with a <db:code>signal</db:code> attribute should not have an <db:code>axis</db:code> attribute.
622                                                </xs:documentation>
623                                        </xs:annotation>
624                                </xs:attribute>
625                                <xs:attribute name="axes" type="nx:NX_CHAR">
626                                        <xs:annotation>
627                                                <xs:documentation>
628                                                        Presence of the <db:code>axes</db:code> attribute means this field is an ordinate.
629                                                       
630                                                        This attribute contains a colon (or comma in legacy files) delimited list
631                                                        of the names of independent axes when plotting this field.
632                                                        Each name in this list must exist as a field in the same group.
633                                                        <!-- perhaps even discourage use of square brackets in axes attribute? -->
634                                                        (Optionally, the list can be enclosed by square brackets but this is not common.)
635                                                        The regular expression for this rule is:
636                                                        <db:programlisting language="c">[A-Za-z_][\w_]*([ :][A-Za-z_][\w_]*)*</db:programlisting>
637                                                </xs:documentation>
638                                        </xs:annotation>
639                                </xs:attribute>
640                                <xs:attribute name="axis" type="nx:NX_POSINT">
641                                        <xs:annotation>
642                                                <xs:documentation>
643                                                        NOTE: Use of this attribute is discouraged.  It is for legacy support.
644                                                        You should use the axes attribute instead.
645                                                       
646                                                        Presence of the <db:code>axis</db:code> attribute means this field is an abcissa.
647                                                       
648                                                        The attribute value is an integer indicating this
649                                                        field as an axis that is part of the data set.
650                                                        The data set is a field with the attribute
651                                                        <db:code>signal="1"</db:code> in the same group.
652                                                        The value can range from 1 up to the number of
653                                                        independent axes (abcissae) in the data set. 
654                                                       
655                                                        A value of <db:code>axis="1</db:code>" indicates that this field
656                                                        contains the data for the first independent axis. 
657                                                        For example, the X axis in an XY data set.
658                                                       
659                                                        A value of <db:code>axis="2"</db:code> indicates that this field
660                                                        contains the data for the second independent axis.
661                                                        For example, the Y axis in a 2-D data set.
662                                                       
663                                                        A value of <db:code>axis="3"</db:code> indicates that this field
664                                                        contains the data for the third independent axis.
665                                                        For example, the Z axis in a 3-D data set.
666                                                       
667                                                        A field with an <db:code>axis</db:code> attribute should
668                                                        not have a <db:code>signal</db:code> attribute.
669                                                </xs:documentation>
670                                        </xs:annotation>
671                                </xs:attribute>
672                                <xs:attribute name="primary" type="nx:NX_POSINT">
673                                        <xs:annotation>
674                                                <xs:documentation>
675                                                        Integer indicating the priority of selection
676                                                        of this field for plotting (or visualization) as an axis.
677                                                       
678                                                        Presence of the <db:code>primary</db:code> attribute means this
679                                                        field is an abcissa.
680                                                </xs:documentation>
681                                        </xs:annotation>
682                                </xs:attribute>
683                                <xs:attribute name="type" type="nx:NAPI" default="NX_CHAR">
684                                        <xs:annotation>
685                                                <xs:documentation>
686                                                        Defines the type of the element as allowed by the NAPI (NeXus Application Programmer Interface).
687                                                        See elsewhere for the complete list of allowed NAPI types.
688                                                </xs:documentation>
689                                        </xs:annotation>
690                                </xs:attribute>
691                                <xs:attribute name="minOccurs" use="optional" default="0" type="nx:nonNegativeUnbounded">
692                                        <xs:annotation>
693                                                <xs:documentation>
694                                                        Defines the minimum number of times this element may be used.  Its
695                                                        value is confined to zero or greater.  Must be less than or equal to
696                                                        the value for the "maxOccurs" attribute.
697                                                        A value of "unbounded" is allowed.
698                                                </xs:documentation>
699                                        </xs:annotation>
700                                </xs:attribute>
701                                <xs:attribute name="maxOccurs" use="optional"  default="1" type="nx:nonNegativeUnbounded">
702                                        <xs:annotation>
703                                                <xs:documentation>
704                                                        Defines the maximum number of times this element may be used.  Its
705                                                        value is confined to zero or greater.  Must be greater than or equal to
706                                                        the value for the "minOccurs" attribute.
707                                                        A value of "unbounded" is allowed.
708                                                </xs:documentation>
709                                        </xs:annotation>
710                                </xs:attribute>
711                                <xs:attribute name="stride" use="optional"  default="1" type="nx:NX_INT">
712                                        <xs:annotation>
713                                                <xs:documentation>
714                                                        The <db:code>stride</db:code> and <db:code>offset</db:code> attributes
715                                                        are used together to index the array of data items in a
716                                                        multi-dimensional array.  They may be used as an alternative
717                                                        method to address a data array that is not stored in the standard NeXus
718                                                        method of "C" order.
719                                                       
720                                                        The <db:code>stride</db:code> list chooses array locations from the
721                                                        data array  with each value in the <db:code>stride</db:code> list
722                                                        determining how many elements to move in each dimension.
723                                                        Setting a value in the <db:code>stride</db:code> array to 1 moves
724                                                        to each element in that dimension of the data array, while
725                                                        setting a value of 2 in a location in the <db:code>stride</db:code> 
726                                                        array moves to every other element in that dimension of the
727                                                        data array.  A value in the <db:code>stride</db:code> list may be
728                                                        positive to move forward or negative to step backward.
729                                                        A value of zero will not step (and is of no particular use).
730                                                       
731                                                        See <db:uri>http://davis.lbl.gov/Manuals/HDF5-1.4.3/Tutor/phypereg.html</db:uri>
732                                                        or <db:emphasis>4. Dataspace Selection Operations</db:emphasis> in
733                                                        <db:uri>http://www.hdfgroup.org/HDF5/doc1.6/Dataspaces.html</db:uri>.
734                                                       
735
736                                                        The <db:code>stride</db:code> attribute contains a
737                                                        comma-separated list of integers.
738                                                        (In addition to the required comma delimiter,
739                                                        whitespace is also allowed to improve readability.)
740                                                        The number of items in the list
741                                                        is equal to the rank of the data being stored.  The value of each
742                                                        item is the spacing of the data items in that subscript of the array.
743                                                </xs:documentation>
744                                        </xs:annotation>
745                                </xs:attribute>
746                                <xs:attribute name="offset" use="optional"  default="1" type="nx:nonNegativeUnbounded">
747                                        <xs:annotation>
748                                                <xs:documentation>
749                                                        The <db:code>stride</db:code> and <db:code>offset</db:code> attributes
750                                                        are used together to index the array of data items in a
751                                                        multi-dimensional array.  They may be used as an alternative
752                                                        method to address a data array that is not stored in the standard NeXus
753                                                        method of "C" order.
754                                                       
755                                                        The <db:code>offset</db:code> attribute
756                                                        determines the starting coordinates of the data array
757                                                        for each dimension.
758                                                       
759                                                        See <db:uri>http://davis.lbl.gov/Manuals/HDF5-1.4.3/Tutor/phypereg.html</db:uri>
760                                                        or <db:emphasis>4. Dataspace Selection Operations</db:emphasis> in
761                                                        <db:uri>http://www.hdfgroup.org/HDF5/doc1.6/Dataspaces.html</db:uri>.
762                                                       
763                                                        The <db:code>offset</db:code> attribute contains a
764                                                        comma-separated list of integers.
765                                                        (In addition to the required comma delimiter,
766                                                        whitespace is also allowed to improve readability.)
767                                                        The number of items in the list
768                                                        is equal to the rank of the data being stored.  The value of each
769                                                        item is the offset in the array of the first data item of that
770                                                        subscript of the array.
771                                                </xs:documentation>
772                                        </xs:annotation>
773                                </xs:attribute>
774                                <xs:attribute name="interpretation" use="optional">
775                                        <xs:annotation>
776                                                <xs:documentation>
777                                                        <db:para> This instructs the consumer of the data what the last dimensions
778                                                        of the data are. It allows plotting software to work
779                                                        out the natural way of displaying the data. </db:para>
780                                                       
781                                                        <db:para> For example a single-element, energy-resolving, fluorescence detector
782                                                                with 512 bins should have <db:code>interpretation="spectrum"</db:code>. If the
783                                                        detector is scanned over a 512 x 512 spatial grid, the data reported
784                                                        will be of dimensions: 512 x 512 x 512.
785                                                        In this example, the initial plotting representation should default to
786                                                        data of the same dimensions of a 512 x 512 pixel <db:code>image</db:code> 
787                                                        detector where the images where taken at 512 different pressure values. </db:para>
788                                                       
789                                                        <db:para> In simple terms, the allowed values mean:
790                                                        <db:itemizedlist>
791                                                                <db:listitem><db:para><db:code>scaler</db:code> = 0-D data to be plotted</db:para></db:listitem>
792                                                                <db:listitem><db:para><db:code>spectrum</db:code> = 1-D data to be plotted</db:para></db:listitem>
793                                                                <db:listitem><db:para><db:code>image</db:code> = 2-D data to be plotted</db:para></db:listitem>
794                                                                <db:listitem><db:para><db:code>vertex</db:code> = 3-D data to be plotted</db:para></db:listitem>
795                                                        </db:itemizedlist> </db:para>
796                                                </xs:documentation>
797                                        </xs:annotation>
798                                        <xs:simpleType>
799                        <xs:restriction base="xs:string">
800                                <xs:enumeration value="scalar"/>
801                                <xs:enumeration value="spectrum"/>
802                                <xs:enumeration value="image"/>
803                                <xs:enumeration value="vertex"/>
804                        </xs:restriction>
805                                        </xs:simpleType>
806                                </xs:attribute>
807                        </xs:extension>
808                </xs:complexContent>
809        </xs:complexType>
810       
811        <xs:complexType name="attributeType">
812                <xs:annotation>
813                        <xs:documentation>
814                                Any new group or field may expect or require some common attributes.
815                                Could contain these elements:
816                                <db:itemizedlist>
817                                        <db:listitem><db:para><db:code>doc</db:code></db:para></db:listitem>
818                                        <db:listitem><db:para><db:code>enumeration</db:code></db:para></db:listitem>
819                                </db:itemizedlist>
820                                (This data type is used internally in the NXDL schema
821                                to define elements and attributes to be used by users in NXDL specifications.)
822                        </xs:documentation>
823                </xs:annotation>
824                <xs:sequence>
825                        <xs:element name="doc" type="nx:docType" minOccurs="0">
826                                <xs:annotation>
827                                        <xs:documentation>
828                                                Description of this <db:code>attribute</db:code>.
829                                                This documentation will go into the manual.
830                                        </xs:documentation>
831                                </xs:annotation>
832                        </xs:element>
833                        <xs:element name="enumeration" type="nx:enumerationType"
834                                minOccurs="0">
835                                <xs:annotation>
836                                        <xs:documentation>
837                                                An enumeration specifies the values to be used.
838                                        </xs:documentation>
839                                </xs:annotation>
840                        </xs:element>
841                </xs:sequence>
842                <xs:attribute name="name" use="required" type="nx:validItemName">
843                        <xs:annotation>
844                                <xs:documentation>
845                                        Unique identifier string (within the enclosing group) for this entity.
846                                </xs:documentation>
847                        </xs:annotation>
848                </xs:attribute>
849                <xs:attribute name="type" type="nx:primitiveType" default="NX_CHAR">
850                        <xs:annotation>
851                                <xs:documentation>
852                                        For <db:code>group</db:code> specifications, the class name.
853                                        For <db:code>field</db:code> or <db:code>attribute</db:code> specifications,
854                                        the NXDL data type.
855                                </xs:documentation>
856                        </xs:annotation>
857                </xs:attribute>
858        </xs:complexType>
859
860        <xs:simpleType name="nonNegativeUnbounded">
861                <xs:annotation>
862                        <xs:documentation>
863                                A <db:code>nonNegativeUnbounded</db:code> allows values including
864                                all positive integers, zero, and the string <db:code>unbounded</db:code>.
865                                (This data type is used internally in the NXDL schema
866                                to define a data type.)
867                        </xs:documentation>
868                </xs:annotation>
869                <xs:union>
870                        <xs:simpleType>
871                                <xs:restriction base="xs:nonNegativeInteger"/>
872                        </xs:simpleType>
873                        <xs:simpleType>
874                                <xs:restriction base="xs:string">
875                                        <xs:enumeration value="unbounded" />
876                                </xs:restriction>
877                        </xs:simpleType>
878                </xs:union>
879        </xs:simpleType>
880
881        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
882       
883        <xs:complexType name="linkType">
884                <xs:annotation>
885                        <xs:documentation>
886                                A link to another item.  Use a link to avoid
887                                needless repetition of information.
888                                (This data type is used internally in the NXDL schema
889                                to define elements and attributes to be used by users in NXDL specifications.)
890                        </xs:documentation>
891                </xs:annotation>
892                <xs:complexContent>
893                        <xs:extension base="nx:basicComponent">
894                                <xs:attribute name="target" use="required" type="nx:validTargetName">
895                                        <xs:annotation>
896                                                <xs:documentation>
897                                                        A link to another item, represented as an
898                                                        absolute path to an existing field such as
899                                                        <db:code>/NXentry/NXinstrument/NXdetector/polar_angle</db:code>.
900                                                        Could contain these elements:
901                                                        <db:itemizedlist>
902                                                                <db:listitem><db:para><db:code>doc</db:code></db:para></db:listitem>
903                                                        </db:itemizedlist>
904                                                        Matching regular expression:
905                                                        <db:programlisting language="c">(/[a-zA-Z_][\w_]*(:[a-zA-Z_][\w_]*)?)+</db:programlisting>
906                                                </xs:documentation>
907                                        </xs:annotation>                                       
908                                </xs:attribute>
909                        </xs:extension>
910                </xs:complexContent>
911        </xs:complexType>
912       
913        <xs:complexType name="docType" mixed="true">
914                <xs:annotation>
915                        <xs:documentation>
916                                NXDL allows for documentation on most elements using the <db:code>doc</db:code>
917                                element. The documentation is useful in several contexts. The documentation will be
918                                rendered in the manual. Documentation, is provided as tooltips
919                                by some XML editors when editing NXDL files.
920                                Simple documentation can be typed directly in the NXDL: <db:example>
921                                        <db:title>simple documentation in NXDL</db:title>
922                                        <db:programlisting language="xml" linenumbering="numbered"
923>&lt;field name="name">
924        &lt;doc>Descriptive name of sample&lt;/doc>
925&lt;/field>                                     </db:programlisting>
926                                </db:example> This is suitable for basic descriptions that do not need extra formatting
927                                such as a bullet-list or a table. For more advanced control, DocBook elements are
928                                allowed, such as the <db:code>NXdetector</db:code> specification.
929                                Refer to examples in the NeXus base class NXDL files such as <db:code>NXdata</db:code>.
930                                Be sure to use the DocBook namespace if the documentation will use any DocBook formatting elements:
931                                <db:code>xmlns="http://docbook.org/ns/docbook"</db:code>
932                                Could contain these elements:
933                                <db:itemizedlist>
934                                        <db:listitem><db:para><db:emphasis>any</db:emphasis></db:para></db:listitem>
935                                </db:itemizedlist>
936                                (This data type is used internally in the NXDL schema
937                                to define elements and attributes to be used by users in NXDL specifications.)
938                        </xs:documentation>
939                </xs:annotation>
940                <xs:sequence>
941                        <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
942                </xs:sequence>
943        </xs:complexType>
944       
945        <xs:complexType name="symbolsType" mixed="true">
946                <xs:annotation>
947                        <xs:documentation>
948                                Each <db:code>symbol</db:code> has a <db:code>name</db:code> and optional documentation.
949                                Please provide documentation that indicates what each symbol represents.
950                                For example:
951                                <db:programlisting language="xml" linenumbering="numbered"
952>&lt;symbols>
953    &lt;symbol name="nsurf">&lt;doc>number of reflecting surfaces&lt;/doc>&lt;/symbol>
954    &lt;symbol name="nwl">&lt;doc>number of wavelengths&lt;/doc>&lt;/symbol>
955&lt;/symbols></db:programlisting>
956                        </xs:documentation>
957                </xs:annotation>
958                <xs:sequence>
959                        <xs:element name="doc" type="nx:docType" minOccurs="0" maxOccurs="1">
960                                <xs:annotation>
961                                        <xs:documentation>
962                                                Describe the purpose of this list of <db:code>symbols</db:code>.
963                                                This documentation will go into the manual.
964                                        </xs:documentation>
965                                </xs:annotation>
966                        </xs:element>
967                        <xs:element name="symbol" minOccurs="0" maxOccurs="unbounded">
968                                <xs:annotation>
969                                        <xs:documentation>
970                                                When multiple <db:code>field</db:code>s share the same dimensions, such as the dimension scales
971                                                associated with plottable data in an <db:code>NXdata</db:code> group, the length of each
972                                                dimension written in a NeXus data file should be something that can be tested by the
973                                                data file validation process.
974                                        </xs:documentation>
975                                </xs:annotation>
976                                <xs:complexType>
977                                        <xs:sequence>
978                                                <xs:element name="doc" type="nx:docType" minOccurs="0" maxOccurs="1">
979                                                        <xs:annotation>
980                                                                <xs:documentation>
981                                                                        Describe the purpose of this <db:code>symbol</db:code>.
982                                                                        This documentation will go into the manual.
983                                                                </xs:documentation>
984                                                        </xs:annotation>
985                                                </xs:element>
986                                        </xs:sequence>
987                                        <xs:attribute name="name" type="nx:validItemName">
988                                                <xs:annotation>
989                                                        <xs:documentation>
990                                                                Mnemonic variable name for this array index symbol.
991                                                        </xs:documentation>
992                                                </xs:annotation>
993                                        </xs:attribute>
994                                </xs:complexType>
995                        </xs:element>
996                </xs:sequence>
997        </xs:complexType>
998       
999        <xs:complexType name="enumerationType">
1000                <xs:annotation>
1001                        <xs:documentation>
1002                                An <db:code>enumeration</db:code> restricts the values allowed for a specification.
1003                                Each value is specified using an <db:code>item</db:code> element, such as:
1004                                <db:code>&lt;item value="Synchrotron X-ray Source" /&gt;</db:code>.
1005                                Could contain these elements:
1006                                <db:itemizedlist>
1007                                        <db:listitem><db:para><db:code>doc</db:code></db:para></db:listitem>
1008                                        <db:listitem><db:para><db:code>item</db:code></db:para></db:listitem>
1009                                </db:itemizedlist>
1010                                (This data type is used internally in the NXDL schema
1011                                to define elements and attributes to be used by users in NXDL specifications.)
1012                                <db:programlisting language="c"
1013>&lt;field name="mode">
1014        &lt;doc>source operating mode&lt;/doc>
1015        &lt;enumeration>
1016                &lt;item value="Single Bunch">&lt;doc>for storage rings&lt;/doc>&lt;/item>
1017                &lt;item value="Multi Bunch">&lt;doc>for storage rings&lt;/doc>&lt;/item>
1018                &lt;!-- other sources could add to this --&gt;
1019        &lt;/enumeration>
1020        &lt;/field></db:programlisting>
1021                        </xs:documentation>
1022                </xs:annotation>
1023                <xs:sequence>
1024                        <xs:element name="item" minOccurs="1" maxOccurs="unbounded">
1025                                <xs:annotation>
1026                                        <xs:documentation>
1027                                                One of the prescribed values.  Use the <db:code>value</db:code> attribute.
1028                                        </xs:documentation>
1029                                </xs:annotation>                               
1030                                <xs:complexType>
1031                                        <xs:annotation>
1032                                                <xs:documentation>
1033                                                        Defines the value of one selection for an <db:code>enumeration</db:code> list.
1034                                                        Each enumerated item must have a value (it cannot have an empty text node).
1035                                                </xs:documentation>
1036                                        </xs:annotation>
1037                                        <xs:sequence>
1038                                                <xs:element name="doc" type="nx:docType" minOccurs="0" maxOccurs="1">
1039                                                        <xs:annotation>
1040                                                                <xs:documentation>
1041                                                                        Individual <db:code>item</db:code>s can be documented
1042                                                                        but this documentation will not be printed in the
1043                                                                        <db:emphasis>NeXus Reference Guide</db:emphasis>.
1044                                                                        When DocBook markup is used,
1045                                                                        be sure to use the provided DocBook namespace prefix
1046                                                                        (<db:code>db:</db:code>) for any DocBook elements,
1047                                                                        such as this example:
1048                                                                        <db:programlisting language="xml">&lt;doc&gt;&lt;db:para&gt;this is documentation with DocBook markup&lt;/db:para&gt;&lt;/doc&gt;</db:programlisting>
1049                                                                </xs:documentation>
1050                                                        </xs:annotation>
1051                                                </xs:element>
1052                                        </xs:sequence>
1053                                        <xs:attribute name="value" use="required">
1054                                                <xs:annotation>
1055                                                        <xs:documentation>
1056                                                                The value of <db:code>value</db:code> of an <db:code>enumItem</db:code>
1057                                                                is defined as an attribute rather than a name.
1058                                                        </xs:documentation>
1059                                                </xs:annotation>
1060                                        </xs:attribute>
1061                                </xs:complexType>
1062                        </xs:element>
1063                </xs:sequence>
1064        </xs:complexType>
1065       
1066        <xs:complexType name="dimensionsType">
1067                <!--
1068                        see TRAC ticket #32: http://trac.nexusformat.org/definitions/ticket/32
1069                -->
1070                <xs:annotation>
1071                        <xs:documentation>
1072                                dimensions of a data element in a NeXus file
1073                                (This data type is used internally in the NXDL schema
1074                                to define elements and attributes to be used by users in NXDL specifications.)
1075                        </xs:documentation>
1076                </xs:annotation>
1077                <xs:sequence>
1078                        <xs:element name="doc" type="nx:docType" minOccurs="0">
1079                                <xs:annotation>
1080                                        <xs:documentation>
1081                                                Documentation might be necessary to describe how the parts
1082                                                of the <db:code>dimensions</db:code> element are to be used.
1083                                        </xs:documentation>
1084                                </xs:annotation>
1085                        </xs:element>
1086                        <xs:element name="dim" minOccurs="0" maxOccurs="unbounded">
1087                                <xs:annotation>
1088                                        <xs:documentation>
1089                                                Specify the parameters for each index of the <db:code>dimensions</db:code>
1090                                                element with a <db:code>dim</db:code> element.
1091                                                The number of <db:code>dim</db:code> entries should be equal to
1092                                                the <db:code>rank</db:code> of the array.
1093                                                For example, these terms
1094                                                describe a 2-D array with lengths (<db:code>nsurf</db:code>, <db:code>nwl</db:code>):
1095                                                <db:programlisting language="c"
1096>&lt;dimensions rank="2">
1097    &lt;dim index="1" value="nsurf"/>
1098    &lt;dim index="2" value="nwl"/>
1099    &lt;/dimensions></db:programlisting>
1100                                                The <db:code>value</db:code> attribute is used by NXDL and also by
1101                                                the NeXus data file validation tools to associate and coordinate the
1102                                                same array length across multiple fields in a group.
1103                                        </xs:documentation>
1104                                </xs:annotation>
1105                                <xs:complexType>
1106                                        <xs:attribute name="index" type="nx:NX_INT" use="required">
1107                                                <xs:annotation>
1108                                                        <xs:documentation>
1109                                                                Number indicating which axis (subscript) is
1110                                                                being described, ranging from 1 up to
1111                                                                <db:code>rank</db:code> (rank of the
1112                                                                data structure).  For example, given an array
1113                                                                <db:code>A[i,j,k]</db:code>,
1114                                                                <db:code>index="1"</db:code> would refer to the
1115                                                                <db:code>i</db:code> axis (subscript).
1116                                                                (<db:code>NXdata</db:code> uses <db:code>index="0"</db:code>
1117                                                                to indicate a situation when the specific index is not
1118                                                                known <db:emphasis>a priori</db:emphasis>.)
1119                                                        </xs:documentation>
1120                                                </xs:annotation>
1121                                        </xs:attribute>
1122                                        <xs:attribute name="value" type="nx:NX_CHAR">
1123                                                <xs:annotation>
1124                                                        <xs:documentation>
1125                                                                Integer length (number of values), or mnemonic symbol
1126                                                                representing the length of this axis.
1127                                                        </xs:documentation>
1128                                                </xs:annotation>
1129                                        </xs:attribute>
1130                                        <xs:attribute name="ref" type="nx:NX_CHAR">
1131                                                <xs:annotation>
1132                                                        <xs:documentation>
1133                                                                The dimension specification is the same as
1134                                                                that in the <db:code>ref</db:code> field, specified either by a relative path,
1135                                                                such as <db:code>polar_angle</db:code> or <db:code>../Qvec</db:code> or absolute path, such as
1136                                                                <db:code>/entry/path/to/follow/to/ref/field</db:code>.
1137                                                        </xs:documentation>
1138                                                </xs:annotation>
1139                                        </xs:attribute>
1140                                        <xs:attribute name="refindex" type="nx:NX_CHAR">
1141                                                <xs:annotation>
1142                                                        <xs:documentation>
1143                                                                The dimension specification is the same as
1144                                                                the <db:code>refindex</db:code> axis within the <db:code>ref</db:code> field.
1145                                                                Requires <db:code>ref</db:code> attribute to be present.
1146                                                        </xs:documentation>
1147                                                </xs:annotation>
1148                                        </xs:attribute>
1149                                        <xs:attribute name="incr" type="nx:NX_CHAR">
1150                                                <xs:annotation>
1151                                                        <xs:documentation>
1152                                                                The dimension specification is related to
1153                                                                the <db:code>refindex</db:code> axis within the <db:code>ref</db:code> field by an
1154                                                                offset of <db:code>incr</db:code>.  Requires <db:code>ref</db:code> and <db:code>refindex</db:code>
1155                                                                attributes to be present.
1156                                                        </xs:documentation>
1157                                                </xs:annotation>
1158                                        </xs:attribute>
1159                                </xs:complexType>
1160                        </xs:element>
1161                </xs:sequence>
1162                <xs:attribute name="rank" type="nx:NX_CHAR">
1163                        <xs:annotation>
1164                                <xs:documentation>
1165                                        Rank (number of dimensions) of the data structure. 
1166                                        For example: <db:code>a[5]</db:code> has <db:code>rank="1"</db:code> while
1167                                        <db:code>b[8,5,6,4]</db:code> has <db:code>rank="4"</db:code>
1168                                        See <db:uri>http://en.wikipedia.org/wiki/Rank_(computer_programming)</db:uri> 
1169                                        for more details.
1170                                </xs:documentation>
1171                        </xs:annotation>
1172                </xs:attribute>
1173        </xs:complexType>
1174       
1175</xs:schema>
Note: See TracBrowser for help on using the repository browser.