Re: Description of textContent incorrect for attributes

/ 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 UTC