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

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

From: Marcos Caceres <marcosscaceres@gmail.com>
Date: Wed, 3 Dec 2008 21:22:00 +0000
Message-ID: <b21a10670812031322w5328b014ub2505647585205df@mail.gmail.com>
To: "Jere Kapyaho" <jere.kapyaho@nokia.com>
Cc: public-webapps <public-webapps@w3.org>

Hi Jere,

On Wed, Dec 3, 2008 at 8:38 AM, Jere Kapyaho <jere.kapyaho@nokia.com> wrote:
> 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.)

I see.

> 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

Ok, thanks for those resources. They were very useful!

Marcos Caceres
Received on Wednesday, 3 December 2008 21:22:53 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:13 UTC