evilGmonkey / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

collect should ignore trailing white spaces in text #334

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) Create a new form with ODK Build
2) Create a text field, give it a name, a caption AND a default value
such as "Test default value"
3) Export to xml; install this form into ODK Collect
4) In ODK Collect, start filling the form

Observed issue: when it comes to the text field, the default value has
extra blank lines and spaces at the beginning and end.

Expected: the value should be the one you inserted in ODK Build,
without any extra spaces.

I guess the cause of this is that the generated form XML has
indentation, and the default values are indented as well, but ODK
Collect takes the whole content of the xml text node, including the
blank spaces at the beginning and end, as the value.

I don't know whether some of the involved standards say that trailing
and ending spaces should be ignored; if they do, then this is a bug in
ODK Collect that doesn't trim the string; if they don't, then this is
a bug in ODK Build that shouldn't add extra spaces and linebreaks
within text nodes.

Original issue reported on code.google.com by yanokwa on 23 Sep 2011 at 5:02

GoogleCodeExporter commented 9 years ago
this is probably something that should be fixed in the core. 

"Well, according to the w3 spec, leading and trailing whitespace is supposed to 
deleted from text nodes:
http://www.w3.org/TR/xmlschema-1/#d0e1654"
-- clint

Original comment by yanokwa on 23 Sep 2011 at 5:02

GoogleCodeExporter commented 9 years ago

Original comment by yanokwa on 4 Oct 2011 at 7:10

GoogleCodeExporter commented 9 years ago
adding test case

Original comment by yanokwa on 6 Oct 2011 at 1:46

Attachments:

GoogleCodeExporter commented 9 years ago
this needs to be submitted to the javarosa repo

Original comment by yanokwa on 30 Oct 2011 at 4:49

Attachments:

GoogleCodeExporter commented 9 years ago
now in javarosa-pending

Original comment by yanokwa on 2 Nov 2011 at 8:19