Enketo Transformer
NodeJS library that transforms OpenRosa/ODK XForms into a format the Enketo understands. It works both as a library module, as well as a standalone app.
Prerequisites
- node v0.10.x is required for now ( see this).
Install as module
npm install enketo-transformer --save
Use as module
var transformer = require('enketo-transformer');
var xform = fs.readFileSync( 'path/to/xform.xml' );
var result = transformer.transform( {
xform: xform
} );
Install as app (web API)
- clone repo
- install dependencies with
npm install
Use as app (web API)
- start with
npm start
- use with queryparameter e.g. with http://localhost:8085/transform?xform=http://myxforms.com/myxform.xml
Response format
{
"form" : "<form>.....</form>",
"model": "<model>...</model>"
}
Test
- install mocha
- run tests with
npm test
Develop
A vagrant configuration file and provisioning script is included.
Change Log
See change log