W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2006

Re: Description of textContent incorrect for attributes

From: Norman Walsh <ndw@nwalsh.com>
Date: Thu, 12 Oct 2006 10:54:24 -0400
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-dom@w3.org
Message-ID: <874pu9eg9r.fsf@nwalsh.com>
/ Boris Zbarsky <bzbarsky@mit.edu> was heard to say:
| Norman Walsh wrote:
|> As attributes have no children, it must always be null.
|
| Last I checked, in DOM Level 3 Attr nodes had children.  At least a
| Text node with the attr value, and possibly EntityReferenceNodes if
| the attr value contained entity references...

Hmm. I traced through Attr before posting, but perhaps I misunderstood.
Indeed, on careful inspection I now see

  In XML, where the value of an attribute can contain entity
  references, the child nodes of the Attr node may be either Text or
  EntityReference nodes (when these are in use; see the description of
  EntityReference for discussion).

So I guess I'm mistaken.

Perhaps then the description of what's returned by createAttribute and
createAttributeNS could be augmented to say that the node created has
no children, or something like that.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Any sufficiently undocumented code is
http://nwalsh.com/            | indistinguishable from magic.

Received on Thursday, 12 October 2006 14:54:45 GMT

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