XLSForm / pyxform

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

Detect ${}-XPath hybrid expressions in labels and put them in outputs #703

Open lognaturel opened 5 months ago

lognaturel commented 5 months ago

Users are fans of our change at https://github.com/XLSForm/pyxform/issues/646 which makes it possible to use instance expressions in labels. Now we've received a request to also detect ${}-XPath hybrid expressions so the same can be done with value lookups in repeats. See the forum.

Expressions would look like: ${plotinfo}[position() = 1]/datagrp/plotname

This will need more sophisticated parsing but I think it's possible to do with minimal risk.

I think it would be riskier to try to detect absolute XPath paths like /data/plotinfo[position() = 1]/datagrp/plotname.