W3C home > Mailing lists > Public > public-xformsusers@w3.org > September 2017

XSD numbers and whitespace (was: Re: Email type)

From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Date: Tue, 12 Sep 2017 12:48:07 -0600
Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, Steven Pemberton <steven.pemberton@cwi.nl>, "public-xformsusers@w3.org" <public-xformsusers@w3.org>
Message-Id: <5CCB907A-A160-4910-98C0-FF68F80BA2C1@blackmesatech.com>
To: Erik Bruchez <ebruchez@orbeon.com>

> On Sep 12, 2017, at 10:24 AM, Erik Bruchez <ebruchez@orbeon.com> wrote:
> What would the rationale be for allowing leading and trailing spaces?
> AFAICT, in XML Schema part 2 numbers, for example, do not allow leading and trailing space in their lexical value.

Yes.  But.

For numbers and some other types, the string of characters in the document is whitespace normalized before it is examined to see if it’s in the lexical space of the type.  So the lexical pattern for integer (for example) does not include leading or trailing white space, but leading and trailing white space can in fact be supplied in the document.  So


both work in documents.

This is not an argument one way or the other on the question before the XForms group, only a reminder that either approach can claim to be aligned with XSD:  no-whitespace is aligned because that’s how XSD defines the lexical spaces of things like numbers, and leading/trailing-whitespace-allowed because that’s how XSD treats data in documents.

I believe the RDF WGs all chose to align with the lexical space (forbidding whitespace).

> I for one much prefer values properly trimmed in the data, and we now have the `whitespace` MIP which takes care of the trimming anyway. [1]

If there’s an MIP, that should probably help.   But I don’t actually want to express (or have) an opinion on this.  Good luck to the group.

> -Erik
> [1] https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_whitespace_Property
> On Tue, Sep 12, 2017 at 3:08 AM, Steven Pemberton <steven.pemberton@cwi.nl> wrote:
> While dealing with the telephone number type, I noticed that our email type doesn't permit leading and trailing spaces.
> I think it should. Agree?
> Steven

C. M. Sperberg-McQueen
Black Mesa Technologies LLC
Received on Tuesday, 12 September 2017 18:48:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:48 UTC