On 12/22/2008 10:37 PM, Dave Cridland wrote:
On Mon Dec 22 13:24:25 2008, Brett Zamir wrote:
In the Data Forms spec XEP-0004, what is an implementation to do for
each type if there are empty fields?
Send an empty<value/> or an empty<field/>?
An empty field would seem to make sense for lists at least, but I
wasn't clear on what it should be for say, text-single.
<value/> is semantically equivalent to <value></value>, and therefore
suggests an actual value of a zero-length string, rather than no value
at all.
Which doesn't answer your question, of course, but it suggests that
the answer might depend on what you mean by "empty fields".
Yeah. Or what the spec using Data Forms means (in whether to allow a
distinction between the two). I think perhaps the specs using Data Forms
should specify this. For example, in Pubsub, where it is used to send in
configuration items, perhaps it wouldn't be a bad idea to require
<value/> to indicate that the sender didn't mistakenly leave out the field.
Otherwise, it is possible one server-side implementation will reject
data that doesn't at least possess a <value/> child and spit out errors,
while another may treat an empty <field/> and <field><value/></field> as
the same, and yet another might spit out errors if there is a <value/>
child, so I really think this should be specified in the specs using
Data Forms, if not also mentioned in Data Forms.
Brett