Other formats for specification files besides XLS (like YAML?)

I believe the ODK specification is specific to XML documents. So, for folks that do not want to edit XML manually the options are XLS Forms or ODK Build (both of which should eventually resolve the data back into XML). I am new to ODK, but am curious to know if other file formats besides XLS have been considered for storing form specifications? What were the pros and cons that have lead to XLS being the de-facto standard?

To me, the structure and layout of large complex forms does not lend itself well to the XLS matrix-style format. Hierarchy and nesting is difficult to parse. Also, changes to XLS binary files are not easy to review via SCMs like Git.

What are some disadvantages that might come through using something like YAML to structure the form specifications instead of XLS?

I assume there is nothing really stopping me from writing specifications in YAML as long as I have a way to convert them to valid ODK XML files in the end. However, since I am new to this ecosystem I wanted to reach out and see what the history was behind the trend towards XLS.

FYI ODK Build has its own JSON file format for saving XForm definitions. It looks like this:

{
  "title": "myform",
  "controls": [
    {
      "name": "name",
      "label": {
        "0": "What is your name?"
      },
      "hint": {},
      "defaultValue": "",
      "readOnly": false,
      "required": false,
      "requiredText": {},
      "relevance": "",
      "constraint": "",
      "calculate": "",
      "length": false,
      "invalidText": {},
      "metadata": {},
      "type": "inputText"
    },
    {
      "name": "age",
      "label": {
        "0": "What is your age?"
      },
      "hint": {},
      "defaultValue": "",
      "readOnly": false,
      "required": false,
      "requiredText": {},
      "relevance": "",
      "constraint": "",
      "calculate": "",
      "range": false,
      "invalidText": {},
      "appearance": "Textbox",
      "kind": "Integer",
      "selectRange": {
        "min": "1",
        "max": "10"
      },
      "selectStep": "1",
      "sliderTicks": true,
      "metadata": {},
      "type": "inputNumeric"
    }
  ],
  "metadata": {
    "version": 2,
    "activeLanguages": {
      "0": "English",
      "_counter": 0,
      "_display": "0"
    },
    "optionsPresets": [],
    "htitle": null,
    "instance_name": "",
    "public_key": "",
    "submission_url": ""
  }
}

myform.odkbuild.txt (804 Bytes)

Correct. Other than form creation tools (most of which are based about XLSForms, as you have observed...), the core ODK form submission, data collection logic, etc is based around by the W3C standard XForms definition.

1 Like