build status

Create a valid JavaRosa FormList of xforms see

defaults(mediaRe, namePath, instancePath)

Default options


parameter type description
mediaRe RegExp RegExp to match any external media referenced in the xForm
namePath String xPath style path to the XML tag that contains the xForm name
instancePath String xPath style path to XML tag that contains the instance (which has the form id and version as attributes)

createFormList(forms, [options], callback)

Creates a valid FormList XML document according to


parameter type description
forms Array An array of Urls for each form, streams (could be a file read stream or a response stream), or full XML text of the form
[options] Object optional: options.downloadUrl is a template for the url where the form is located, in the format${formId}.xml. ${formId} will be replaced by the actual form Id of each form. options.manifestUrl is the url template for the location of the manifest xml document (only included if external media is referenced in the xForm)
callback Function Called with (err, data) where data is a valid formListAPI Xml document


var createFormList = require('openrosa-formlist');

var forms = [

createFormList(forms, function(err, data) {
  console.log(data) // outputs formList Xml


Requires nodejs.

$ npm install openrosa-formlist


$ npm test


See it on GitHub

Return to Code