orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
511 stars 220 forks source link

XPath errors using `fr:date` in plain XForms #6347

Closed avernet closed 1 month ago

avernet commented 1 month ago

Most, if not all, fr:…() functions don't make sense outside of Form Runner, and sometimes fail if we try to call them. So one idea was to use the xxbl:keep-if-function-available and xxbl:keep-if-function-unavailable attributes to, say, have two versions of an xf:var, where one could use fr:…() functions, and one wouldn't.

The problem is that this mechanism is static and can't be used for xxbl:serialize-external-value, where we would like to use fr:…() functions, like fr:component-param-value('week-start-day') in the case of date.xbl. We could:

That second option seems simpler and would keep the code of the XBL lighter.

Also see #5533, where we made similar reflections for the fr:number.

+1 from customer

avernet commented 1 month ago

Test case: view.txt.

avernet commented 3 weeks ago

For the placeholder to work, we need to have an explicit xml:lang="en" in the document. It would be nice not to have such a requirement and to use a default language if no xml:lang is found. We already have an oxf.fr.default-language.*.* property, but we don't have an equivalent property at the XForms level. Using such a property could be done in XXFormsResource.scala, but I am not sure it is worth introducing an additional property for such a narrow use case. For now, we are just leaving things as they stand.