1. Is it okay to have incomplete data?
Yes. One of the features of XML in general is that data elements and attributes can be either required or optional. This flexibility means that data can be included when it exists, and left out when it doesn't exist. In the case of CXML, if you had to include a missing data value for every element for which you didn't have data, the files would get extremely large. You could design CXML to have fewer elements, but then the format would be less useful to a variety of users. We felt that the flexibility offered by XML was worthwhile enough to make it worth getting out of the "fixed format" mode.
Click here to see an example of a "bare minimum" data file.
2. How should missing data be handled when reading CXML?
XML readers have to be able to handle the situation where data for many elements may not exist. Logically, it has to do something like, "if <element> exists then get its value, if not then assume a missing data value". This complicates the file-reading code somewhat, which could be seen as a negative aspect of using XML.
3. How should missing data be handled when writing CXML?
There are a few ways missing data can be handled:
(a) omit the element entirely (so long as the element is not required by CXML - if it is then use one of the next two options)
(b) specify a missing value in the metadata (e.g. -999), then apply the missing data value where needed. For example:
<header>
...
<missing>-999</missing>
...
</header>
<data type="analysis">
...
<pressure units="hPa">-999</pressure>
...
</pressure>
(c) include xsi:nil="true" as an attribute of the data element. This looks like:
<pressure units="hPa" xsi:nil="true" />
Of these three options, (a) and (b) are probably more intuitive. The empty element will not work in general:
<pressure units="hPa"></pressure>
don't do this
<pressure units="hPa" />
don't do this either
Why are those examples problematic? The CXML schema specified that there should be a numerical data value and will complain if there's nothing there. The exception to this condition is when the expected data is a string value, in which case a null string is okay, or if the tag is a wrapper for other dataeg:
<cycloneData />
4. Can new data elements be added and if so, how?
As an XML format, CXML is "extensible", making is possible for users to add their own elements or combine it with other data in XML format. (will write more on this later)
5. Are XML tags case sensitive?
Yes, they are case sensitive. This is not valid:
<PRESSURE units="hPa">979.</PRESSURE>
6. Can CXML include forecasts from multiple models?
Yes. The <data> element includes an attribute for the origin of the data, so each model forecast can be separately identified. For example:
<data type="forecast" origin="NCEP">
