On 12/22/08 8:28 AM, Brett Zamir wrote:
> 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.

As Dave said, <value></value> means the empty string (which in pubsub
configuration forms might mean the root collection node).

IMHO if the sender mistakenly leaves out a field, that is the sender's
problem. The recipient's behavior should be to leave the existing values
alone (if any).

> 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.

I admit that error handling related to data forms is less than perfect.
However, for pubsub at least I will try to clarify this in the next
revision of the spec.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to