rustxform-validate
Structural validations and non-fatal warnings over a parsed
Survey, run between parsing and
emission in the rustxform pipeline.
parse ─▶ Survey ─┬─▶ validate ─▶ (blocking errors?)
└─▶ xform ─▶ XForm XML
API
/// Blocking problems; empty when the form is valid.
;
/// Non-fatal warnings; needs the raw workbook for header checks.
;
ValidationError (blocking)
DuplicateName/EmptyName— node naming problems.UnknownReference { owner, reference }— a${…}that names no node.UnknownChoiceList { question, list }— aselect_*over a missing list.InvalidRange { question, reason }— malformedrangeparameters.InvalidGeoDefault { question, value }— a geodefaultthat is not;-separatedlat lon altitude accuracypoints.
Warning (non-fatal)
MissingSetting— e.g. noform_title/form_id(a default is used).UnknownColumn— an unrecognizedsurveycolumn header (likely a typo).UnknownLanguageTag— a language without a recognizable subtag code (ISO 639-1 two-letter, or any three-letter code).
Both enums implement std::error::Error via Display, so they print clean
messages.
Example
use read_markdown;
use workbook_to_survey;
use ;
let wb = read_markdown.unwrap;
let survey = workbook_to_survey.unwrap;
let errors = validate;
assert!;
Note
Internal building block of the rustxform workspace. The top-level
rustxform crate runs this for you via
its build_* / convert_*_checked functions.
License
Licensed under either of Apache-2.0 or MIT at your option.