W3C home > Mailing lists > Public > public-xformsusers@w3.org > March 2016

Draft text for whitespace MIP

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 23 Mar 2016 12:55:12 +0100
To: "public-xformsusers@w3.org" <public-xformsusers@w3.org>
Message-ID: <op.yer0qan6smjzpq@steven-aspire-s7>
As yyou can see, writing this left me with some questions that I would  
like to discuss today.

Steven

6.1.x The whitespace property[edit]

Description: specifies a value that indicates how whitespace is to be  
treated when converting input strings to data.

Computed Expression: No. [?]

Legal Values:
	preserve: all whitespace is preserved
	trim: remove all whitespace from beginning and end of string
	remove: remove all whitespace
	collapse: replace each occurrence of multiple white space with a single  
space character.

Default Value: preserve. [Type dependent? What do we say about numbers for  
instance?]

Inheritance Rules: does not inherit.[?]

Description.
This property specifies how whitespace whould be treated when a string is  
converted to a value, for instance from an input control. If the datatype  
allows contained spaces, then the whitespace property describes what  
should happen to contained whitespace.

Example
<instance>
   <payment xmlns="">
     <amount/>
     <name/>
     <cardnumber/>
   </payment>
</instance>
<bind ref="name" whitespace="trim collapse"/> [allow or create a single  
value?]
<bind ref="cardnumber" type="card-number" whitespace="remove"/>

Here, the whitespace property indicates that if a user inputs a value for  
name, the leading and trailing spaces will be removed, and all other  
consecutive sequences of whitespace will be collpased to a single space;  
if the user inputs a credit card number with embedded spaces, those spaces  
will be removed before the value is added to the instance.
Received on Wednesday, 23 March 2016 11:55:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 23 March 2016 11:55:48 UTC