W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

Re: Document::createAttribute()

From: Arnaud Le Hors <lehors@us.ibm.com>
Date: Thu, 30 Mar 2000 09:25:22 -0800
Message-ID: <38E38E02.E0C20341@us.ibm.com>
To: www-dom@w3.org
keshlam@us.ibm.com wrote:
> 
> >What was the rationale behind having the createAttribute() factory
> >method in Document instead of Element?
> 
> Weak rationalle: An Attr, like most other nodes, is always associated with
> an owning document. It isn't associated with an Element until it's bound to
> one via setAttributeNode[NS].

And even then, it can be removed from that element and attached to
another. Creating the Attr node from an element would seem to imply it
can only be used with this one element. Which the WG has decided not to
be the case.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group
Received on Thursday, 30 March 2000 12:25:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:47 GMT