9/1/00
The development of the h5gen tool uncovered several 'bugs' in the DTD. We propose to update the DTD now, so the h5gen tool will be in phase when it is released in a few weeks.
This note is a request for comment and discussion.
If there are no objections, we'll plan to release the revised DTD around
Sept. 1.
[ Original DTD ]
[ Revised DTD ]
[ diff -c ]
Changes
The definition of <Dataset> defines all the elements in a specific order. HDF5 doesn't care about the order, but XML enforces it, and when parsing, the elements are encountered in the specified order. For parsing software, it is convenient to have all the information necessary to create the dataset before encountering anything that must be written to the dataset. So, the last two elements should be Attribute* and Data, and StorageLayout? should be moved earlier in the list.
The DTD is changed to move the Attribute* element from the first position to the fourth position.
*** 75,81 ****
<!ATTLIST DatasetPtr
OBJ-XID IDREF #REQUIRED
>
! <!ELEMENT Dataset (DatasetPtr|(Attribute*,Dataspace,(DataType|NamedDataTypePtr),Data,StorageLayout?))>
<!ATTLIST Dataset
& Name CDATA #REQUIRED
& OBJ-XID ID #REQUIRED
--- 80,86 ----
<!ATTLIST DatasetPtr
OBJ-XID IDREF #REQUIRED
>
! <!ELEMENT Dataset (DatasetPtr|(StorageLayout?,Dataspace,(DataType|NamedDataTypePtr),Attribute*,Data))>
<!ATTLIST Dataset
& Name CDATA #REQUIRED
& OBJ-XID ID #REQUIRED
**************
The original DTD allowed the <RootGroup> to optionally be a GroupPtr. This would mean that the root group is defined somewhere in the body of the XML, and the first element is just a pointer to that <Group>. While this is conceivable, it creates difficulties for parsers.
The DTD is changed to no longer allow the <RootGroup> to
be a pointer.& The definition of <GroupPtr> is moved down.
*** 34,44 ****
LengthSize CDATA #REQUIRED
OffsetSize CDATA #REQUIRED
>
!& <!ELEMENT GroupPtr EMPTY>
!& <!ATTLIST GroupPtr
!&& OBJ-XID IDREF #REQUIRED
!& >
!& <!ELEMENT RootGroup
&& (GroupPtr|(Attribute*,Group*,Dataset*,NamedDataType*,SoftLink*))>
&& <!ATTLIST RootGroup
&& Name CDATA #FIXED "/"
&& OBJ-XID ID #REQUIRED
--- 34,45 ----
& LengthSize CDATA #REQUIRED
& OffsetSize CDATA #REQUIRED
>
! <!--
!&& The root group is the same as any other group, except
!&& its name is fixed. Also, the RootGroup may not be
!&& a GroupPtr.
! -->
! <!ELEMENT RootGroup (Attribute*,Group*,Dataset*,NamedDataType*,SoftLink*)>
& <!ATTLIST RootGroup
&& Name CDATA #FIXED "/"
&& OBJ-XID ID #REQUIRED
***************
The DTD defined an attribute of a floating point datatype that has some of the HDF5 type codes, H5T_IEEE_F32BE, etc. The enumerated list was wrong and incomplete, and should be deleted.
Also, there was an attribute for 'MatissaSize' but not 'MatissaLocation'.
The attributes of the <DataType> were changed to fix these
bugs.
** 123,129 ****
&& ExponentBits CDATA #REQUIRED
&& ExponentLocation CDATA #REQUIRED
&& MantissaBits CDATA #REQUIRED
!&& TypeCode (H5T_STD_IEEE32|H5T_STD_IEEE64|etc) #REQUIRED
& >
& <!ELEMENT TimeType EMPTY>
& <!ELEMENT StringType EMPTY>
--- 128,134 ----
&& ExponentBits CDATA #REQUIRED
&& ExponentLocation CDATA #REQUIRED
&& MantissaBits CDATA #REQUIRED
!&& MantissaLocation CDATA "0"
& >
& <!ELEMENT TimeType EMPTY>
& <!ELEMENT StringType EMPTY>
***********