XLSForm / pyxform

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

Use of _count in variable name results in duplicate survey element error #576

Closed yanokwa closed 7 months ago

yanokwa commented 2 years ago

Software and hardware versions

pyxform v1.7.0

Steps to reproduce the problem

  1. Upload circuit_first.xlsx to https://getodk.org/xlsform/. Screen Shot 2021-12-05 at 20 59 38
  2. You will get this error: Error: There are more than one survey elements named 'circuit_count' (case-insensitive) in the section named 'data'.
  3. If you replace circuit_count with circuit_countx, the form converts with no problems. Screen Shot 2021-12-05 at 21 04 08
lognaturel commented 2 years ago

Related: https://github.com/XLSForm/pyxform/issues/435

lognaturel commented 2 years ago

This is indeed annoying and pretty easy to run into. I think we should look at addressing @MartijnR's case 1 in https://github.com/XLSForm/pyxform/issues/435: if the repeat_count is a simple reference, just use the ref and don't introduce another one. We didn't want to do that while Aggregate was still in common use because it would be a schema change but now I believe all common servers do allow those.