Re: Document::createAttribute()

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 UTC