-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output empty <label/>
instead of omitting it.
#439
Comments
@lognaturel / @MartijnR it looks like the error for no hint comes from ODK Validate rather than pyxform. Should pyxform warn / error about no hint, or just emit a label to comply with the spec and ODK Validate? It doesn't seem like an error is necessary, since adding the empty label XML node shouldn't affect how the survey works. But maybe it does for some tools? |
Hi @lindsay-stevens. Welcome back!
If ODK Validate does not get fooled by an empty label (and still requires either a label or hint text content), then I think outputting an empty label in pyxform is all that is required. |
@lindsay-stevens Are you already working on this? If not I might be able to take a swing at it! let me know either way |
@MartijnR thanks! |
- as per pyxform/XLSForm#439, should always output a label node even if there is no label specified. - pyxform had a warning for no label but this is removed since there is no requirement for a label. - add tests to verify that a label is output and no warning raised - fix existing tests that either expected a warning or no label
- label check block applies to questions and other item types such as groups and repeats, so may be valid in other scenarios - for example this block is referenced in XLSForm#542 - will require further changes to exclude question items from the check since that is the intent in XLSForm#439
- as per pyxform/XLSForm#439, should always output a label node even if there is no label specified. - pyxform had a warning for no label but this is removed since there is no requirement for a label. - add tests to verify that a label is output and no warning raised - fix existing tests that either expected a warning or no label
- label check block applies to questions and other item types such as groups and repeats, so may be valid in other scenarios - for example this block is referenced in XLSForm#542 - will require further changes to exclude question items from the check since that is the intent in XLSForm#439
Currently pyxform requires either a value in the "label" column or in the "hint" column for form controls (ie. questions in the body). This validation rule can remain unchanged.
However, as @tiritea discovered, a
<label>
element is actually required according to the XForms spec. Therefore, we should include an empty<label/>
(or<label></label>
) element in the body output. This is currently not the case.Test 1
The text was updated successfully, but these errors were encountered: