Skip to main content

Crate rxform

Crate rxform 

Source
Expand description

rxform — a Rust implementation of pyxform: converts XLSForm spreadsheets into ODK XForm XML.

let xml = rxform::convert_file(std::path::Path::new("survey.xlsx")).unwrap();
println!("{xml}");

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

error
Error type carrying the spreadsheet location (sheet / row / column) and a probable cause or fix suggestion, so form authors can find mistakes fast.
model
In-memory representation of a parsed XLSForm.
parser
Parses generic sheet data (survey/choices/settings) into a Survey tree.
types
Question type definitions, ported from pyxform’s question_type_dictionary.py.
xform
Generates ODK XForm XML from a parsed Survey, following pyxform’s output conventions (element order, itext ids, ${ref} expansion).
xls
Workbook reading: turns an .xlsx/.xls/.ods file into generic sheet data.
xmlwriter
Minimal XML tree + pretty printer matching pyxform’s output conventions: 2-space indentation, alphabetically sorted attributes, self-closing tags for childless elements without text, and <tag></tag> for empty text.

Structs§

Conversion
A finished conversion: the XForm document plus the itemsets.csv companion file when the workbook has an external_choices sheet.

Functions§

convert
Convert an XLSForm workbook file, returning all conversion outputs.
convert_file
Convert an XLSForm workbook file (.xlsx/.xls/.ods) to XForm XML.
convert_workbook
Convert already-loaded sheet data to XForm XML. fallback_name supplies the form id/name/title when the settings sheet does not define them.
convert_workbook_full
Convert already-loaded sheet data, returning all conversion outputs.