Best way to store XML in HDF5

Hello,

I have a table in XML that I want to store in HDF5. I have figured
out how to store the table. The problem I am running into is how to
store the metadata. Does anyone have experience doing this? My
current solution is to use a single attribute with nested compound
types, but that feels messy. I found this page

  https://www.hdfgroup.org/HDF5/XML/

but that is only HDF5->XML, not the other way around. I also found
references to h5gen, but I am having problems finding the source.

Thanks,
Walter Landry

p.s. "h5dump --xml" fails when reading one of my sample hdf5 files.

I handled it by simply putting it into a n by 1 byte array DataSet. Essentially treating it like a file and letting my app read and parse the bytes back. You could do the same in an Attribute--I chose a DataSet because I was storing a rather large file and also wanted to apply hdf compression filters (I was actually using .json, but it is exactly the same for xml).

Warm regards,
Jim

···

-----Original Message-----
From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Walter Landry
Sent: Thursday, August 27, 2015 3:47 PM
To: hdf-forum@lists.hdfgroup.org
Subject: [Hdf-forum] Best way to store XML in HDF5

Hello,

I have a table in XML that I want to store in HDF5. I have figured out how to store the table. The problem I am running into is how to store the metadata. Does anyone have experience doing this? My current solution is to use a single attribute with nested compound types, but that feels messy. I found this page

  https://www.hdfgroup.org/HDF5/XML/

but that is only HDF5->XML, not the other way around. I also found references to h5gen, but I am having problems finding the source.

Thanks,
Walter Landry

p.s. "h5dump --xml" fails when reading one of my sample hdf5 files.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Thanks, but I think that is not going to work for me. I would like it
to show up in an intelligible format when I use standard tools
(e.g. h5dump, hdfview).

Cheers,
Walter Landry

···

"Rowe, Jim" <J.Rowe@questintegrity.com> wrote:

I handled it by simply putting it into a n by 1 byte array DataSet.
Essentially treating it like a file and letting my app read and
parse the bytes back. You could do the same in an Attribute--I
chose a DataSet because I was storing a rather large file and also
wanted to apply hdf compression filters (I was actually using .json,
but it is exactly the same for xml).

Hi,

> I handled it by simply putting it into a n by 1 byte array DataSet.
> Essentially treating it like a file and letting my app read and
> parse the bytes back. You could do the same in an Attribute--I
> chose a DataSet because I was storing a rather large file and also
> wanted to apply hdf compression filters (I was actually using .json,
> but it is exactly the same for xml).

Thanks, but I think that is not going to work for me. I would like it
to show up in an intelligible format when I use standard tools
(e.g. h5dump, hdfview).

Then you have answered your own question. You need to prepare the data as an
array and write it as any other data. This is the only way to have the data show
up "normally" in the HDF5 tools.

Metadata is stored in HDF5 attributes:
https://www.hdfgroup.org/HDF5/Tutor/crtatt.html#def

Regards,

Pierre

···

On Fri, Aug 28, 2015 at 07:14:37AM -0700, Walter Landry wrote:

"Rowe, Jim" <J.Rowe@questintegrity.com> wrote: