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

Re: Attr nodes

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Thu, 14 Feb 2002 13:21:03 -0500
To: <www-dom@w3.org>
Message-ID: <OF5637C2F3.6A3F5825-ON85256B60.0063F52B@pok.ibm.com>

Don't confuse IDL attributes with implementation fields. An IDL attribute
is just a value you can read or set. Where it's stored is a completely
separate issue, and is up to the implementation.

The DOM API says that the Attr node's value is always equal to the
concatenation of the values of its Text descendents, and that when you set
this node's value that's taken as a request to replace those descendents
with a single Text node containing the new value. I don't think we actually
said whether it will be a new Text node, or whether one of the existing
Text children of the Attr (if any) will be reused by having the new value
assigned to it. I believe either is acceptable.

So setting this value changes the Attr's children, and changes the Attr's
node value because that value is derived from the children.


Whether this involves changing a value field inside the Attr is an
implementation issue. Some implementations may want to cache the Attr's
node value rather than doing the concatenation each time it's called for.
An implementation which does so must deal with updating that cache when the
Attr's children are changed, either by manipulating them directly or by
setting the Attr node's value... but that's all invisible to the DOM user.


______________________________________
Joe Kesselman  / IBM Research
Received on Thursday, 14 February 2002 13:21:39 GMT

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