ddiToXlsform rejects a <var> that has no ID, and the message says there is no <var> at all.
ddiToXlsform('<var name="x"><qstn responseDomainType="text"><qstnLit>Hi</qstnLit></qstn></var>')
// ConversionError ddi-invalid: The input holds no <codeBook> and no <var>.
ddiToXlsform('<var ID="V1" name="x"><qstn responseDomainType="text"><qstnLit>Hi</qstnLit></qstn></var>')
// { survey: [{ type: 'text', name: 'x', label: 'Hi' }], … }
(v0.7.0, found through qwacback's POST /api/convert/ddi-to-xlsform.)
Why it matters
- DDI 2.5 makes
var/@ID optional, so this is valid DDI. The ddi2xlsform README says it "never refuses DDI it can parse".
- The message sends users looking for the wrong problem: the
<var> is there.
Suggestion
Read a var without ID, falling back to @name where an ID is needed (varGrp/@var can't refer to it anyway). If it has to be refused, name the reason, e.g. "<var name=\"x\"> has no ID".
Low priority: everything formtransform writes has IDs, and so do qwacback's seeds.
ddiToXlsformrejects a<var>that has noID, and the message says there is no<var>at all.(v0.7.0, found through qwacback's
POST /api/convert/ddi-to-xlsform.)Why it matters
var/@IDoptional, so this is valid DDI. The ddi2xlsform README says it "never refuses DDI it can parse".<var>is there.Suggestion
Read a
varwithoutID, falling back to@namewhere an ID is needed (varGrp/@varcan't refer to it anyway). If it has to be refused, name the reason, e.g. "<var name=\"x\">has noID".Low priority: everything formtransform writes has IDs, and so do qwacback's seeds.