Skip to main content

Crate rustxform_xform2json

Crate rustxform_xform2json 

Source
Expand description

Parse an XForm back into the Survey model (the reverse direction).

This is a near-complete inverse of the forward emitter. It recovers the form settings (title, id, version, style, instance_name), the full question tree (groups, repeats with repeat_count), bind logic (relevant / constraint / required / read_only / calculate and messages, as literal XPath), appearance, inline choice lists and select_*_from_file, top-level data-only nodes (calculate, metadata preloads, audit), entities, and <itext> — multilingual labels/hints/messages/choice labels plus label media and single-language guidance/media.

Because the forward emitter only rewrites ${…} tokens and passes other expressions through unchanged, these forms round-trip byte-identically: emit(xform_to_survey(emit(survey))) == emit(survey) (see the property test).

Data-only nodes (calculate, preloads) are placed at any depth by merging the primary-instance tree with the body tree, and pulldata() CSV instances regenerate from the recovered calculations. Use it to import or inspect an XForm.

Enums§

Xform2JsonError
An error produced while parsing an XForm.

Functions§

xform_to_survey
Parse an XForm document into a Survey.