[Nexus] Fwd: Re: [NeXus-tech] XML and new attribute

Eugen Wintersberger eugen.wintersberger at desy.de
Fri Feb 13 09:08:27 GMT 2015


I think I should be more explicit what I want to do. 
We use XML files to store templates for Nexus files for different
beamline setups (that's the simple version of what we are doing). 


> Eugen:
> 
> > <field name="phi" type="NX_FLOAT" depends_on="chi"
> > transformation_type="rotation" vector="0,1,0" offset="0,0,0">
> >
> > </field>
> 
> Here, the attributes are used as part of the NXDL language and describe
> the content of an NXDL document.  Not what you want.  The content of
> this example that reveals why you should not use this example is the
> presence of specific data values.

Ok. I think I got that.

> 
> 
> > <field name="phi" type="NX_FLOAT">
> > 	<attribute name="depends_on" type="NX_CHAR">chi</attribute>
> > 	<attribute name="transformation_type" type="NX_CHAR">rotation</attribute>
> > 	<attribute name="vector" type="NX_FLOAT"> 0 1 0 </attribute>
> > 	<attribute name="offset" type="NX_FLOAT"> 0 0 0 </attribute>
> > </field>
> 
> Here, the NXDL attribute elements describe how to store content in a
> NeXus HDF5 data file.  The NXDL does not describe just one HDF5 file but
> rather any NeXus HDF5 file that uses this NXDL.  This example might be
> what you want.  But, why do you want to store *any* data values in an
> NXDL file?

See above - we use them as templates containing beamline specific
information. Static data will be stored directly in the XML data. Our
idea was to stick as close as possible with the NXDL language for our
template language (we cannot follow the standard for instance with types
where we use type="float32" or type="float64" instead of NX_FLOAT). 

So I should have asked more precisely what would be close to NXDL -
storing the attributes as parts of the tags or as children of the field
tag. 

> 
> The data file fragment you describe has this structure:
> 
>    phi: NX_FLOAT
>      @depends = chi
>      @transformation = rotation
>      @vector:NX_FLOAT = [0 1 0]
>      @offset:NX_FLOAT = [0 0 0]
> 
> In the nxdl.xsd (rules for NXDL files), these four attributes should be
> optional for any field.  (Not sure that has been implemented yet.)

If I sum this up: mandatory attributes go into the field tag itself
(like type, name, units, long_name, etc.) and are thus part of the NXDL
language. Optional attributes are stored as children of the field tag
and hence cannot be part of the NXDL language.  

> 
> Hope this helps.
> 
> Pete
> 
> 
> 

-- 
------------------------------------
Dr. Eugen Wintersberger         
                                    
FS-EC                              
DESY                    
Notkestrasse 85                       
D-22607 Hamburg                    
Germany                            
                                   
E-Mail: eugen.wintersberger at desy.de
Telefon: +49-40-8998-1917          
-----------------------------------



More information about the NeXus mailing list