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

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
http://datadriven.com.au

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