Re: Required but empty

I agree with Ulrich.  The meaning of empty string is clear, and a string 
with spaces in it is not empty because it has spaces in it.


I do agree that this is different than what a user-friendly interpretation 
might mean, but this would not be the only place where such technicalities 
cause us a little grief.  Here are a few other favorites:
1) having to say true() and false() rather than true and false 
2) Having empty string not be the same thing as zero in XPath mathematical 
operations
3) Empty string being unacceptable lexically for many schema datatypes

Still, these don't mean our issues are ill-defined.  Just that right now a 
form author would have to do more work to address the situation when there 
should be no distinction between two things like whitespace string and 
empty string.

John M. Boyer, Ph.D.
STSM: Lotus Forms Architect and Researcher
Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer





Ulrich Nicolas Lissé <unl@dreamlab.net> 
Sent by: www-forms-editor-request@w3.org
05/29/2007 02:43 PM

To
ebruchez@orbeon.com
cc
public-forms@w3.org, www-forms-editor@w3.org
Subject
Re: Required but empty







Erik,

I think an empty string is clearly a zero-length string. While this
might be owed to a technical background I see the usability issue.
However, you could avoid whitespace-only strings from being submitted with

<xf:bind ... constraint="string-length(normalize-space(.)) > 0"/>

or by defining a subtype of xs:string disallowing whitespace-only
character sequences. This is a bit tedious for the for author, but I
don't think we should handle empty and whitespace-only strings equally
in general. I can't think of a half-decent use case for whitespace-only
strings right now, but I'm convinced some form author will have a use
case requiring white space to submit.

Regards,
Uli.

Erik Bruchez wrote:
> 
> All,
> 
> I have a doubt about the meaning of "empty" in the wording "required but
> empty" (which appears in 11.2.3 and 4.3.5).
> 
> It seems that "empty" could either mean:
> 
> 1. A zero-length string (clear technical interpretation)
> 2. A string empty as per #1 above, or a string with only white-space
>    (human-friendly interpretation)
> 
> Imagine a user entering by error a space in an input field. Visually,
> with most agents (typically web browsers), you can't tell whether the
> field is empty according to #1 above, or contains white space. So to the
> user, the field is "empty".
> 
> But if the XForms implementation implements #1, then this visually empty
> field will be considered non-empty, and pass submission even if 
required.
> 
> This would favor an interpretation of "empty" where not only strictly
> empty strings are "empty", but also strings containing only white space.
> 
> At the very least, the spec should say whether it means #1, #2, or
> implementation-dependent.
> 
> -Erik
> 


-- 
Ulrich Nicolas Lissé

Received on Wednesday, 30 May 2007 02:09:17 UTC