Can't deploy forms using normalize-space()

The title says it all. I’ve tried deploying xlsforms that use normalize-space() in both kobo.humanitarianresponse.info & kobo.unhcr.org but neither one would let me.

Here’s a minimalist example of an xlsform that triggers the error:

type	    name	     label	        calculation
calculate	test		                normalize-space('foo    bar')

And here’s the text of the error message that comes up:

your form cannot be deployed because it contains errors:

ODK Validate Errors: >> Something broke the parser. See above for a hint. Error evaluating field ‘test’: The problem was located in calculate expression for ${test} XPath evaluation: cannot handle function ‘normalize-space’ Caused by: org.javarosa.xpath.XPathUnhandledException: The problem was located in calculate expression for ${test} XPath evaluation: cannot handle function ‘normalize-space’ … 10 more Result: Invalid

Any support with the issue would be greatly appreciated.

1 Like

Hi,
Welcome to the community forum. Could you please test your form here

Stephane

Hi Stephanealoo,

The forms seem to pass validation but fails deployment nonetheless.

Any ideas?

Hello @stephanealoo, @galalH,
Example is working with Enketo and with https://getodk.org/xlsform/.(check, preview and download XForm)
So, probably a KoBoCAT problem and specific to calculation.

We use normalize-space as constraint in KoBoCollect without problems
string-length(normalize-space(.)) = 0
This can still be deployed today.
Also a constraint (or a relevant) like normalize-space(‘foo bar’) = ‘foo bar’ can be deployed for the given example

The deployment error is the same, if you use “::.” or a reference ${text}.
Should be reported as BUG to developers and fixed urgently, as this may touch some normalize-space usage,

2 Likes

Hi @galalH,

Thank you for flagging this through the community! FYI, kindly please be informed that i have created a GitHub issue for the same which can be followed here:

2 Likes