MSLNZ / equipment-register-schema

XML Schema Definition (XSD) for an Equipment Register
https://mslnz.github.io/equipment-register-schema/
0 stars 0 forks source link

use XML format when storing a calibration as a GTC Archive #10

Closed jborbely closed 3 months ago

jborbely commented 5 months ago

With the release of GTC 1.5.0, an Archive may be serialized in either JSON or XML format. Currently, only the JSON format is expected in the equipment-register schema and it must be updated to allow the XML format.

Should an equipment register still allow the JSON format?

rebeccahawke commented 4 months ago

I think it would be helpful to allow both formats in the schema if it's not too much trouble to do so.

jborbely commented 4 months ago

Fixed in 1fe446c490481e761982127da6de6193a6d636e6. Support both JSON and XML formats.

Mention the loads_json and loads_xml functions in the docs.

jborbely commented 3 months ago

The changes to the documentation in 1fe446c were not a good idea. Still need to think about this some more.

jborbely commented 3 months ago

Decide (in 449736eb4256af2c1ca935d6d82f48ca644032e2) to create a <serialised> element that can choose between different storage formats. This allows for other storage formats to be added later.

If the storage format has its own XSD file (like GTC does) it can be imported in equipment-register.xsd so that the content of the storage text can be validated.

The XSD pseudo-code is


<serialised>
  <xsd:choice>
    <gtcArchive/>
    <gtcArchiveJSON/>
    <anotherFormat/>
  </xsd:choice>
</serialised>
``