XLSForm / pyxform

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

URLs with hyphens fail validation #533

Closed yanokwa closed 3 years ago

yanokwa commented 3 years ago

A URL widget with a hyphen fails with the following...

ODK Validate Errors:
>> XForm is invalid. See above for the errors.
: Invalid XPath in value set action declaration: 'https://sites.google.com${covid19-vaccination}'
    Problem found at nodeset: ${model}[@xforms-version=1.0.0]/setvalue
    With element <setvalue event="odk-instance-first-load" ref="${url}" value="https://sites.google.com${covid19-vaccination}"/>

The following files failed validation:
url.xml

Here's the XML that is produced with xls2xform --skip_validate

url with hypen

<instance>
    <data id="url">
        <url/>
        <meta>
            <instanceID/>
        </meta>
    </data>
</instance>
<bind nodeset="/data/url" type="string"/>
<setvalue event="odk-instance-first-load" ref="/data/url" value="https://sites.google.com/view/covid19-vaccination"/>
<bind jr:preload="uid" nodeset="/data/meta/instanceID" readonly="true()" type="string"/>

url without hyphen

<instance>
    <data id="url">
        <url>https://sites.google.com/view/covid19vaccination</url>
        <meta>
            <instanceID/>
        </meta>
    </data>
</instance>
<bind nodeset="/data/url" type="string"/>
<bind jr:preload="uid" nodeset="/data/meta/instanceID" readonly="true()" type="string"/>
lognaturel commented 3 years ago

Duplicate of #495