getodk / xforms-spec

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. ✨⚒✨
https://getodk.github.io/xforms-spec/
31 stars 26 forks source link

Describe defaults of optional range attributes #184

Closed MartijnR closed 6 years ago

MartijnR commented 6 years ago

min=[minimum value] (default 1) max=[maximum value] (default 10) step=[step size] (default 1)

lognaturel commented 6 years ago

Should this perhaps be an XLSForm issue? I know we discussed defaults there for convenience but I thought we were making them required at the XForms level.

MartijnR commented 6 years ago

Oh yes, that's an option. In XForms they are all optional (without defaults apparently, so that's weird) so we'd have to clarify the requiredness in this spec then.

MartijnR commented 6 years ago

Shall we document that we deviate by making them all required?

lognaturel commented 6 years ago

Does https://www.w3.org/TR/xforms11/#ui-range say that defaults can be specified in the model for all range elements in a form? Do you know what that syntax would look like? I don't think we have a precedent for doing something like that so I'd be comfortable with saying they're required in the body.

Another deviation is that we only have defined them for integers and decimals, not for dates and the other semantic types this spec doesn't support (e.g. year).

MartijnR commented 6 years ago

Not sure. It could be that they are referring to constraints there.

I'd be happy with making them required. It's clear and as you said we have XLSForm/ODK Build to apply default values to the XForm anyway, so almost nobody is inconvenienced.

MartijnR commented 6 years ago

Also would be easy to remove the requirement unlike adding it later.

lognaturel commented 6 years ago

It could be that they are referring to constraints there.

Seems possible.

Also would be easy to remove the requirement unlike adding it later.

Good point. Ok, let's do required.