W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: Attributes contain redundant properties?

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Thu, 30 Aug 2001 15:11:11 -0400
To: www-dom@w3.org
Message-ID: <OFBE8C112F.522DAE59-ON85256AB8.00690CE2@pok.ibm.com>

>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 GMT

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