XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
80 stars 136 forks source link

Always generate secondary instance for selects #603

Closed lognaturel closed 1 year ago

lognaturel commented 2 years ago

Software and hardware versions

pyxform v1.9.0

We've had various conversations about selects and when they're generated as inline/static or as secondary instances/dynamic starting with https://github.com/XLSForm/pyxform/issues/203. There are various issues around them such as https://github.com/XLSForm/pyxform/issues/387#issuecomment-947845840 and https://github.com/XLSForm/pyxform/issues/590

In https://github.com/XLSForm/pyxform/issues/590 we are coming to the conclusion that it'd be better to always generate secondary instances and use itemsets.

I believe there are currently two cases that require inline/static choices:

Any other cases that might be special or need static selects?

lognaturel commented 2 years ago

@lindsay-stevens You up for taking this on soon? Let me know if you want to discuss before diving in.

lindsay-stevens commented 2 years ago

This is in progress. It'll be a big PR because the initial change (i.e. ignoring cases requiring static for now) causes ~30 tests to fail. For some of the tests I'm doing a quick-fix on, such as those testing internals e.g. builder_tests.py. Others using assertPyxformXform are being refactored from xmlcontains to xmlxpath_match as part of fixing them, which sometimes takes a bit of git archaeology if the test intent isn't obvious.