[Nexus-developers] Nxtranslate in 3.0?

Akeroyd, FA (Freddie) F.A.Akeroyd at rl.ac.uk
Thu Jun 9 14:24:19 BST 2005


> 
> Freddie,
> I support something like this, because one of the things I recently
> realized
> is that NXtoXML (or nxtoxml) was written before the XML API was added,
and
> was really intended for illustrative purposes.  It writes the XML
> manually,
> the main drawback of which is that it transcribes the global
attributes,
> including the HDF version that is no longer valid.  Of course, I could
> just
> change the global attributes, but I think it makes more sense to have
a
> global "nxconvert" routine using the API for both reading and writing.
> 
> The only question I have is - what should be the default conversion?
> Should
> we assume that HDF4 is to be converted to HDF5 and vice-versa, and is
> there
> a way to automatically check which libraries are available anyway?
> 
Ray,

We would need to add an API function to determine whether a file is HDF4
or HDF5 as currently I don't think there is a way. Also if the input is
XML, what should the default conversion be? It may just be safer to have
no default conversion and force the user to always specify it with an
option. 

If you specify a conversion for which the library is not
available/installed, the command will fail as NXopen will then produce
an error. I could make nxconvert cleverer and only compile in e.g. the
"-h5" option if HDF5 is available

>
> P.S. NXtoDTD strips the data as well.  If we add a --dtd version to
> "nxconvert", will the XML API produce the right results if we just
leave
> out the NXputdata calls?
>
Not quite - see http://bugs.isis.rl.ac.uk/show_bug.cgi?id=863

Freddie





More information about the NeXus-developers mailing list