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. There is an outstanding issue with Node v0.12.x.
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
- clone repo
- install dependencies with
npm install
Use as app
- start with
npm start
- use with queryparameter e.g. with http://localhost:8085/transformer?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