Giter VIP home page Giter VIP logo

getodk / xforms-spec Goto Github PK

View Code? Open in Web Editor NEW
30.0 25.0 26.0 227 KB

The XForms-derived specification used in the ODK ecosystem. If you are interested in building a tool that is compliant with the forms rendered by ODK tools, this is the place to start. ✨⚒✨

Home Page: https://getodk.github.io/xforms-spec/

JavaScript 16.43% CSS 63.61% HTML 19.66% Ruby 0.30%
odk data-collection global-development global-health xforms-spec odk-xforms

xforms-spec's Introduction

ODK XForms Spec

Published at https://getodk.github.io/xforms-spec/

Requirements for running locally

Install Jekyll (Windows users, see here) and bundler.

Afterwards, to install all dependencies for this repo:

bundle install

Run locally

When editing use jekyll serve or bundle exec jekyll serve to build, start up a webserver and automatically rebuild on http://localhost:4000/xforms-spec/.

Contributing

Pull requests are welcome for any agreed-upon issues! Propose a specification addition or change or join the live conversation in the xforms-spec channel of the ODK Slack.

Specification changes

This specification is not a fixed document and is regularly extended with new features. Occassionally, poor earlier choices are removed, and behavior is clarified or corrected. To propose a small correction or clarification, just open an issue here. For a more significant change in the XForms specification, the following approach should be used:

  1. Post a proposal in the ODK Forum (e.g. under the Development category and tagged with spec-proposal and odk-xforms). If you have a proposed XForm (and/or XLSForm) syntax, please include it.
  2. If the ODK community is interested and a syntax candidate emerges, there will be a vote according to the ODK Voting Rules.
  3. Once the extension is approved any relevant issues will be created in this repo, in pyxform and in the XLSForm documentation and the implementation can go ahead.

If you propose a specification addition that does not make it through the approval process (e.g. because it is considered to be for a too-specific use case), the recommended way to add it to your own application is to use your own custom namespace for any new elements or attributes. This will avoid conflicts with any future features in the ODK XForms Specification (or the W3C XForms specification). If in the future, the situation changes and ODK would like to adopt the feature after all, the common practise would be to include it using your namespace.

xforms-spec's People

Contributors

alxndrsn avatar cooperka avatar divya063 avatar eyelidlessness avatar jkpr avatar lognaturel avatar martijnr avatar mbaudier avatar seadowg avatar ukanga avatar yanokwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xforms-spec's Issues

calculate answers from a multiple select

I have a multiple select question in ODK, I want a user to select any number of options and then be able to give answers to those questions. Based on those chosen questions, I want to calculate the total. Its seeming impossible to crack even with most answers as default.
How can we solve this problem?

clarify choice value restrictions for select and select1

I think the only restriction is spaces for a select and for this reason strongly recommending to apply the same no-whitespace-restriction to select1 option values (so that a select1 could easily be changed into a select).

min() and max() to accept nodeset for all argument

Originally reported on Google Code with ID 1044

When working on the ODK spec, I noticed that min() and max() only accept the NodeSetType
for the first argument (or am I misreading?).

Would seems worthwhile (and easy enough) to change this to allow any argument to be
of NodeSetType. This would make it conform to XPath 2.0: http://www.w3.org/TR/xpath-functions/#func-max

Already the case in Enketo.

Reported by [email protected] on 2014-08-14 21:36:58

Add function to remove duplicates from a list of values

De-duplicating values can be helpful to do things like generating random numbers without duplicates as described in this mailing list thread.

SurveyCTO has shared implementations for several useful functions here including de-duplicate() which takes two strings as parameters: a delimiter and a string to de-duplicate. For example, passing in "," and "value1,value2,value1" gives "value1,value2" as its result.

XPath 2.0 defines a function called distinct-values which operates on a sequence.

It does not appear that Dimagi-xforms includes this functionality.

media file types not described

It might be useful to specify the file formats and any other requirements that need to be considered in order to include media in forms.

Add pulldata()

Would like to come up with a more XForms and XPath-compliant way of doing this. Will propose something if nobody beats me to it.

Proposal: External secondary instances (as in CommCare)

Also described here from an ODK Collect perspective and in an old wider discussion here.

As in https://dimagi.github.io/xform-spec/#secondary-instances---external, this feature just adds support for src attribute on a secondary instance and a jr://file connector for the src value.

<instance src="jr://file/countries.xml" />

I propose to start with only supporting the jr://file connector for now, and then build upon this feature in the future (e.g. by adding CSV support). This means the same resource retrieval method as jr://image, jr://audio and jr://video can be used.

Until now there is no proper agreement to add external data. This addition would not require re-inventing the wheel and as a bonus brings us closer to CommCare, raising the prospect for future compatibility.

acknowledge

The OpenRosa XForm Doc formed the basis of this spec but this is not mentioned anywhere.

add once()

ODK and SurveyCTO both support a once() function now, most often used with random() like so:

once(random())

The idea is that only one value is generated per form instance; once the form has a value, it maintains that value rather than replacing it. once() takes one parameter (a function call or expression).

Without this function, for example, random() was inappropriate for randomizing survey elements because the random draw would be re-calculated periodically (and, certainly, when saving and then editing). once() is also helpful when, e.g., capturing the date and time when a part of the survey is first reached. There may be other potential uses as well.

barcodes should be more permissive?

The barcode data type is currently listed as "string consisting only of alphanumeric characters". However, using QR codes some users are undoubtedly storing URLs and other strings that contain non-alphanumeric characters. Is there a reason to restrict the barcode datatype to alphanumeric?

add new math functions

remove type="select" and type="select1"?

Commcare doesn't actually do anything with this information (just treated as string). Does ODK's javarosa do anything with it?

If not, shall we remove from the spec? (any unknown type would be treated as string).

ODK Validate not accepting (any) property() functions

Originally reported on Google Code with ID 1034

What steps will reproduce the problem?
1. Upload attached form on http://opendatakit.org/use/xlsform/


What is the expected output? What do you see instead?

Successful transformation to XForm expected. Instead get this error: 

Error: ODK Validate Errors:
org.javarosa.core.log.WrappedException: Error evaluating field 'a': No storage factory
has been set; I don't know what kind of storage utility to create. Either set a storage
factory, or register your StorageUtilitys directly. => java.lang.RuntimeException[No
storage factory has been set; I don't know what kind of storage utility to create.
Either set a storage factory, or register your StorageUtilitys directly.]

What version of the product are you using? On what operating system?
latest on http://opendatakit.org/use/xlsform/ (also seen on ona.io)


Reported by [email protected] on 2014-07-22 20:12:33


- _Attachment: [property.xlsx](https://storage.googleapis.com/google-code-attachments/opendatakit/issue-1034/comment-0/property.xlsx)_

preloaders/metadata

Would love to make the metadata functionality more elegant, using the fact that generating metadata should follow a pre-defined algorithm in all clients (e.g. instanceID is always 'uuid:'+uuid()).

Is metadata currently always (or almost always) placed inside a <meta> block as direct child of the root node?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.