1. What is the issue? Please be detailed.
The string-length() function seems to count any sequence of multiple blancs/spaces only as 1 character. So, a string like " abc def "
(3 leading, 3 middle, 3 trailing blanks) will be counted as length = 8, instead of really 15 characters.
It seems a more general issue: How multiple spaces in strings are treated. Also a comparison seems to treat multiple spaces as one. For ex. " a b cd "
= " a b cd " >> true.The same reduction of multiple spaces seems to happen through generating the XForm, what might explain the strange results from the functions.
2. What steps can we take to reproduce this issue?
See example and screenshots below.
StringLength01.xlsx (10.6 KB)
For comparison
StringCompareSpaces01.xlsx (10.1 KB)
Generated XForm (download from XLSForm Online)
The original string " a b cd "
losses the multiple spaces and becomes: " a b cd "
(i.e. " a b cd ")
3. What have you tried to fix the issue?
Tried the different examples, looked at XML specification, searched forum.
Compared with normalize() function. View generated X-Form.
I could not find any documentation for this behaviour (which is also different to normalization).
4. Upload any forms or screenshots you can share publicly below.
The XLSForm
XLSForm Online
ODK Collect
Deployment was done with KoboToolbox. Maybe, to test with Central too?