W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2008

Re: [widgets] Trimming attribute values, a bad idea?

From: Jere Kapyaho <jere.kapyaho@nokia.com>
Date: Wed, 03 Dec 2008 10:38:18 +0200
To: ext Marcos Caceres <marcosscaceres@gmail.com>, public-webapps <public-webapps@w3.org>
Message-ID: <C55C121A.43A4%jere.kapyaho@nokia.com>

On 3.12.2008 4.51, "ext Marcos Caceres" <marcosscaceres@gmail.com> wrote:
> Got a question... I've relaxed keyword attributes to be allowed to
> have leading and trailing whitespace. Now, widget user agents are
> required to trim whitespace prior to validation/processing. Widget
> user agents must only perform literal comparisons with trimmed values,
> and must not perform case insensitive comparisons.
> 
> So, for instance, <access network="     false    "> is ok.
> 
> Does anyone see any problem with this? Should I revert back to being
> strict and having UA do comparisons without trimming?

In the context of XML, I guess that instead of 'trimming' a slightly more
accurate term/concept would be 'attribute value normalization' [1], which
also includes compressing runs of white space into one. An interesting
discussion appears in 'Processing XML with Java' [2]. Based on that, it
might be better to just *not* do it, but then you wouldn't be XML compliant.
(So you could say that if an implementation doesn't, then it isn't.)

Note that in XML this is specified in terms of DTD datatypes, but the config
document is described in RELAX NG. It might not make a difference; maybe [3]
gives a better idea about how this pans out in practice.

[1] http://www.w3.org/TR/REC-xml/#AVNormalize
[2] http://www.cafeconleche.org/books/xmljava/chapters/ch01s02.html#d0e951
[3] http://books.xmlschemata.org/relaxng/relax-CHP-7-SECT-4.html

--Jere
Received on Wednesday, 3 December 2008 08:39:03 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:28 GMT