X XForm Engine
Rust + WebAssembly

Render XForms
at native speed

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.

Everything you need to render XForms

Full OpenRosa spec support, compiled to WebAssembly for blazing-fast performance in any browser.

WASM Performance

Core logic runs as WebAssembly — parsing, validation, and calculations execute at near-native speed.

🌐

Multi-language (iText)

Full iText support with runtime language switching. No page reload needed.

Validation

Required fields, constraints, regex patterns, and localized error messages via jr:constraintMsg.

🔎

Relevance & Calculate

Dynamic show/hide with relevant expressions. Auto-calculated fields with correct evaluation order.

🔁

Repeat Groups

Add/remove repeating sections. Serialized to proper XML sibling elements for submission.

📦

Zero Dependencies

No React, no Angular, no Vue. Pure Rust core + vanilla JS renderer. Drop it into any project.

All the widgets you need

Comprehensive widget support following the OpenRosa specification.

Text Input Textarea Radio (select1) Dropdown (minimal) Checkbox (select) File Upload Date Time DateTime Repeat Groups

Simple API, powerful forms

Drop XForm Engine into your project with just a few lines of JavaScript.

1

Import & initialize

import { Form } from './pkg/form.js';

const form = new Form(xformXml, {
  lang: 'English',              // optional: default language
  instanceXml: serverData       // optional: pre-fill data
});
2

Render & interact

await form.render(document.getElementById('form'));

// Switch language at runtime
form.setLanguage('Русский');
3

Validate & submit

if (form.validate()) {
  const xml   = form.getDataStr();  // submission XML
  const files = form.getFiles();    // [{ ref, file }]
  // send to your server
}

Built for performance

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.

R
Rust / WASM

Parsing, validation, relevance, calculations, submission XML

J
JavaScript

DOM rendering, event handling, public API (Form class)

C
CSS (Tailwind)

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   │
└─────────────────────────────┘

Get in touch

Interested in using XForm Engine, have questions, or want to collaborate? Reach out directly.

orozulbaev@gmail.com