XLSForm / pyxform

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

Detect instance() expressions in notes and make them into outputs #646

Closed lognaturel closed 10 months ago

lognaturel commented 12 months ago

Software and hardware versions

All versions

Problem description

If you put an instance() expression in a note such as instance('stuff')/root/item[name=${thing}]/label, it's not recognized by pyxform. The XML output will be something like instance('stuff')/root/item[name=<output value=" /data/thing "/>]/label. This means any secondary instance property to display must be stored in a calculate.

Steps to reproduce the problem

Put the expression above in a form. For example: https://docs.google.com/spreadsheets/d/1f1CN4o62T9m5IUIhaW3wS25ga1W9RNl6TFGktAQjMKY/edit#gid=0

Expected behavior

instance() expressions are also put in outputs.

Desired XML output: instance_notes.xml.zip

We also will need to think of where best to document this pattern.