Suggestion, not planned yet.
Since formtransform v0.7.0 (#154, #160), the library has ddiToXlsform(xml, { onWarning }). It turns DDI-Codebook 2.5 XML back into an XLSForm and runs in the browser. The app could offer it as a fourth tab, "DDI → XLSForm".
What the library gives
ddiToXlsform(xml, options?) → { survey, choices, settings } (sheet rows, XlsformOutput).
- It reads a whole codebook, a
dataDscr, or bare var / varGrp elements, and never refuses DDI it can parse.
- A CDL codebook (written by this app's Kobo tab or by
xlsformToDdi) comes back exactly. The library round-trip tests DDI → XLSForm → DDI byte for byte.
- DDI from other tools converts as far as its standard elements go, with a
ddi-field-missing warning per field it can't supply.
- Still lost: unregistered types such as
calculate, and a few cell spellings (src/pipelines/ddi2xlsform/README.md in the library).
What the app would need
- A
Ddi2XlsformTab.svelte: file input for .xml, Convert, download form.xlsx, and an optional preview of the survey sheet.
- Writing the three sheets to
.xlsx with SheetJS, which is already a dependency (xlsx). Keep the column order the library returns.
- Warnings through the existing
ErrorBox (warnings prop). They matter here: DDI from other tools produces ddi-field-missing findings the user should see.
- i18n strings (DE/EN) for the tab label, file label and hint.
- A short line in the scope notice or the tab: exact round trips only for CDL codebooks.
Tests
- Golden: for every
ddi.xml in the fixtures archive (registry types and survey fixtures), upload it and compare the downloaded workbook's sheets with the library's own ddiToXlsform(xml) output.
- Round trip through the GUI: Kobo tab →
survey.xml → DDI tab → form.xlsx → Kobo tab gives the same DDI.
- GUI: a non-CDL DDI fragment converts and shows
ddi-field-missing warnings.
- Accessibility: add the tab to
accessibility.spec.ts.
Suggestion, not planned yet.
Since formtransform v0.7.0 (#154, #160), the library has
ddiToXlsform(xml, { onWarning }). It turns DDI-Codebook 2.5 XML back into an XLSForm and runs in the browser. The app could offer it as a fourth tab, "DDI → XLSForm".What the library gives
ddiToXlsform(xml, options?) → { survey, choices, settings }(sheet rows,XlsformOutput).dataDscr, or barevar/varGrpelements, and never refuses DDI it can parse.xlsformToDdi) comes back exactly. The library round-trip tests DDI → XLSForm → DDI byte for byte.ddi-field-missingwarning per field it can't supply.calculate, and a few cell spellings (src/pipelines/ddi2xlsform/README.mdin the library).What the app would need
Ddi2XlsformTab.svelte: file input for.xml, Convert, downloadform.xlsx, and an optional preview of the survey sheet..xlsxwith SheetJS, which is already a dependency (xlsx). Keep the column order the library returns.ErrorBox(warningsprop). They matter here: DDI from other tools producesddi-field-missingfindings the user should see.Tests
ddi.xmlin the fixtures archive (registry types and survey fixtures), upload it and compare the downloaded workbook's sheets with the library's ownddiToXlsform(xml)output.survey.xml→ DDI tab →form.xlsx→ Kobo tab gives the same DDI.ddi-field-missingwarnings.accessibility.spec.ts.