XForm Engine is a lightweight OpenRosa/ODK XForm renderer built with Rust and compiled to WebAssembly. No heavy frameworks, no runtime overhead — just fast, spec-compliant form rendering in the browser.
Full OpenRosa spec support, compiled to WebAssembly for blazing-fast performance in any browser.
Core logic runs as WebAssembly — parsing, validation, and calculations execute at near-native speed.
Full iText support with runtime language switching. No page reload needed.
Required fields, constraints, regex patterns, and localized error messages via jr:constraintMsg.
Dynamic show/hide with relevant expressions. Auto-calculated fields with correct evaluation order.
Add/remove repeating sections. Serialized to proper XML sibling elements for submission.
No React, no Angular, no Vue. Pure Rust core + vanilla JS renderer. Drop it into any project.
Comprehensive widget support following the OpenRosa specification.
Drop XForm Engine into your project with just a few lines of JavaScript.
import { Form } from './pkg/form.js';
const form = new Form(xformXml, {
lang: 'English', // optional: default language
instanceXml: serverData // optional: pre-fill data
});
await form.render(document.getElementById('form'));
// Switch language at runtime
form.setLanguage('Русский');
if (form.validate()) {
const xml = form.getDataStr(); // submission XML
const files = form.getFiles(); // [{ ref, file }]
// send to your server
}
The heavy lifting — XML parsing, XPath evaluation, constraint validation, and submission building — happens in Rust, compiled to WebAssembly. The JavaScript layer handles only DOM rendering.
Parsing, validation, relevance, calculations, submission XML
DOM rendering, event handling, public API (Form class)
Styling via CDN — easily customizable or replaceable
// Architecture overview
┌─────────────────────────────┐
│ Your Application │
│ (Alpine, React, Vue, etc.) │
└──────────┬──────────────────┘
│
┌──────────▼──────────────────┐
│ form.js (JS API) │
│ render() · validate() │
│ getDataStr() · getFiles() │
└──────────┬──────────────────┘
│ WASM calls
┌──────────▼──────────────────┐
│ Rust / WebAssembly │
│ parser · evaluator · model │
│ parse_xform · validate │
│ get_relevant · build_xml │
└─────────────────────────────┘
Interested in using XForm Engine, have questions, or want to collaborate? Reach out directly.
orozulbaev@gmail.com