W3C home > Mailing lists > Public > www-svg@w3.org > April 2010

Re: xlink:href test case

From: Robin Berjon <robin@berjon.com>
Date: Fri, 16 Apr 2010 10:32:32 +0200
Cc: www-svg WG <www-svg@w3.org>
Message-Id: <7CF7D5D5-04F9-4EAD-ACD0-636D8360984E@berjon.com>
To: Anne van Kesteren <annevk@opera.com>
On Apr 16, 2010, at 06:56 , Anne van Kesteren wrote:
> On Fri, 16 Apr 2010 00:55:16 +0900, Robin Berjon <robin@berjon.com> wrote:
>> It's annoying that this produces different results across browsers though, the error handling should hopefully be the same (which as Erik noted is partly an issue with DOM 3 Core).
> 
> setAttribute() should probably be defined to either override the value of an attribute that matches the "tag name" given or set an attribute that is not in a namespace if there is no such attribute currently.

I'm okay with the first, but the second is a problem because if the prefix is unbound the document cannot then be serialised to XML. The following might work:

Given setAttribute("foo:bar", "unidahut"),

  - if there is an attribute the qualified name of which is "foo:bar", its value gets updated
  - if there is no such attribute, but there is a namespace in scope for prefix "foo", then a foo:bar attribute is created with that prefix and that namespace
  - if there is no such attribute and no matching namespace in scope, a "bar" attribute is created, with no prefix and in no namespace

But I guess that's a topic for DOM 4 Core to address.

-- 
Robin Berjon - http://berjon.com/
Received on Friday, 16 April 2010 08:33:02 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:44 GMT