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,

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 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:13 UTC