Problem description
I would like to be able to easily strip leading and trailing whitespace in ODK. Because of how keyboards on Android tablets or phones work, spaces are often added at the end text entry. This can be a problem when trying concat(${name}, '-', ${age}) and expecting there not to be whitespace. Another issue would be if pressing and a newline is at the end of ${name}.
Proposed solution
I propose to implement the normalize-space
XPath 2.0 function in Javarosa. For a definition, see https://www.w3.org/TR/xpath-functions-31/#func-normalize-space.
This function works on whitespace in the middle of text as well, but that is suitable to me.
I am interested in the one-argument form, but the spec defines a zero-argument form as well. What comments are there surrounding these two forms? Which to include?
This function would fit nicely in the spec at https://opendatakit.github.io/xforms-spec/#fn:String-Functions
Related material
Source github issue: https://github.com/opendatakit/javarosa/issues/460
Postscriptum
@LN would you please tag important stakeholders for this topic?