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

RE: Should Attr nodes store their values in a child text node?

From: Kartikaya Gupta <kagupta@rim.com>
Date: Mon, 14 Jan 2008 09:45:39 -0500
Message-ID: <24BE9C481C439C48831EB9E52639B9B60A8D47D6@XCH42YKF.rim.net>
To: "Michael A. Puls II" <shadow2531@gmail.com>
Cc: <www-dom@w3.org>

Your last couple of messages seem to agree with (at least my
interpretation of) the spec.

> In Firefox, createEntityReference is present, but it returns null,
which 
> causes a pointer error when you try to append it to anything.
> 
> Opera doesn't support createEntityReference.

>From http://www.w3.org/TR/DOM-Level-2-Core/core.html, under the
description for "createEntityReference", it says that the implementation
should throw a NOT_SUPPORTED_ERR if the document is an HTML document. So
I guess I was wrong in my original statement; HTML documents aren't
allowed to have entity references. However, full XML documents should be
allowed to have entity references, and so attribute nodes there should
allow child nodes that are entity references.

> Anyway, what I'm getting at is that if browsers don't support entity 
> references in Attr nodes, then there's not much use for browsers
having a 
> child text node. Just using .value or .nodeValue to get the attribute 
> value as a string should be fine.
> 
> Or, do you think that regardless, a child text node should still be 
> created and made available for acess like Safari and FF do?

It does appear that current browser implementations do not fully support
this DOM functionality, and that just using .value and .nodeValue is
probably fine.


> But, if there's no doubt that a text node should be created and
> revealed with Attr.firstChild and Attr.childNodes[0] in all cases,
> then I guess it's just a bug in Opera. (Looking for more comments
> still though just to be sure.)

Agreed, that makes sense.

Kartikaya Gupta

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
Received on Monday, 14 January 2008 14:45:54 GMT

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