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

Revised text for Whitespace MIP

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 30 Mar 2016 13:19:18 +0200
To: "public-xformsusers@w3.org" <public-xformsusers@w3.org>
Message-ID: <op.ye4xqgifsmjzpq@steven-aspire-s7>
6.1.x The whitespace property

Description: specifies how whitespace is treated when converting strings  
to data.

Computed Expression: No.

Legal Values: preserve, trim, remove, collapse, normalize.

Default Value: preserve.

Inheritance Rules: does not inherit.

Description.

This property specifies how whitespace must be treated when a string is  
converted to the value that the property is attached to, for instance from  
an input control:

	preserve: all whitespace is preserved
	trim: all whitespace from the beginning and end of the string is removed
	remove: all whitespace is removed
	collapse: each occurrence of multiple whitespace is replaced with a  
single space character (0x20)
         normalize: a combination of 'trim' and 'collapse'.

Whitespace is any character defined as whitespace ("WSpace=Y", "WS") in  
the Unicode Character Database [ref: "The Unicode Standard". Unicode  
Consortium.]

Example

	<instance>
	  <payment xmlns="">
	    <amount/>
	    <name/>
	    <cardnumber/>
	  </payment>
	</instance>
	<bind ref="amount" type="decimal"/>
	<bind ref="name" whitespace="normalize"/>
	<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 whitespace will be removed, and all other  
consecutive sequences of whitespace will be collapsed to a single space;  
if the user inputs a credit card number with embedded whitespace, that  
whitespaces will be removed before the value is added to the instance. For  
the amount value, by default, whitespace is preserved, but since the  
schema lexical space for numbers allows leading and trailing whitespace,  
such whitespace (but not embedded whitespace) will not effect validity.
Received on Wednesday, 30 March 2016 11:19:54 UTC

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