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
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
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).
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).
> 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.