Re: Document::createAttribute()

>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].

> wouldn't it make more sense to have the factory method in Element?

There is one: the setAttribute() call. More convenient if the Attr's value
will be a single Text node, less convenient if it will be more complicated.

______________________________________
Joe Kesselman  / IBM Research

Received on Thursday, 30 March 2000 10:11:10 UTC