Re: Attributes contain redundant properties?

>Can anybody tell me why there are DOMStrings defined in the Attr interface

>for name and value of an attribute?

"DOM Level 0" compatability.  They're identical to and interoperable with
the corresponding Node properties.

>Then what does "value" field
>holds if a Text node already contains the attribute's value?

Don't confuse IDL attributes with fields. Everything in the DOM should be
considered an abstract interface, and most things that look like fields
should be considered accessors. In specific, reading an Attr node's value
returns the concatenation of the contents of all contained Text nodes,
while writing replaces the contents with a single text node having the new
value.



______________________________________
Joe Kesselman  / IBM Research

Received on Thursday, 30 August 2001 15:11:46 UTC