XLSForm/pyxform

itextId node not added to instance items for choice list names with dashes in multilingual forms

lognaturel opened this issue · 2 comments

Software and hardware versions

pyxform v2.0.0

Problem description

If a choice list has a dash in its name and the form has multi-lingual labels, itextId nodes are not generated for the items in the instance. This means labels don't get displayed.

Steps to reproduce the problem

  1. Convert a form like this one which has choice lists with dashes and multi-language choice labels
  2. See that the generated instance does not include itextId nodes:
            <instance id="labels-only">
                <root>
                    <item>
                        <name>choice1</name>
                    </item>
                    <item>
                        <name>choice2</name>
                    </item>
                </root>
            </instance>

Expected behavior

The generated instance should include itextId nodes, just like it does if the list name has underscores:

            <instance id="labels_only">
                <root>
                    <item>
                        <itextId>labels_only-0</itextId>
                        <name>choice1</name>
                    </item>
                    <item>
                        <itextId>labels_only-1</itextId>
                        <name>choice2</name>
                    </item>
                </root>
            </instance>

Other information

Image and audio choices don't seem affected, only text ones

A user seems to have run into a different manifestation of this. I'm not exactly sure how it differs yet and will try to have a minimal sample form soon. Currently I'm wondering whether it could be that repeats are a special case, that seems to often be the case.

I'm pretty sure it's a different problem.