XLSForm / pyxform

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

Forbid colon as first character in XML identifiers #630

Open lognaturel opened 1 year ago

lognaturel commented 1 year ago

Colons are currently allowed as the first character of XML identifiers: https://github.com/XLSForm/pyxform/blob/master/pyxform/xlsparseutils.py#L8

This is consistent with https://www.w3.org/TR/REC-xml/#NT-NameStartChar but doesn't really make sense in real usage as described at https://stackoverflow.com/a/40446164/137744

We should probably forbid colons in the identifiers at all since we don't really support namespacing of body elements (https://github.com/XLSForm/pyxform/issues/105#issuecomment-1305977323).

lognaturel commented 1 year ago

Validate doesn't allow leading colons anyway so we really should update the message and logic.