W3C home > Mailing lists > Public > www-archive@w3.org > April 2009

Re: Web DOM Core - createElement(tagName)

From: Simon Pieters <simonp@opera.com>
Date: Tue, 14 Apr 2009 11:42:37 +0200
To: "Jason Harrop" <jharrop@gmail.com>
Cc: "www-archive@w3.org" <www-archive@w3.org>
Message-ID: <op.usdelbmvidj3kv@zcorpandell.linkoping.osa>
On Thu, 09 Apr 2009 01:15:01 +0200, Jason Harrop <jharrop@gmail.com> wrote:

> Hi Simon
>
> I was looking at Web DOM Core - Work in Progress — Last Update 6 April
> 2009 which says:
>
> "The createElement(tagName) method must run the following steps:
>
>    1.  If tagName doesn't match the Name production in XML, raise an
> INVALID_CHARACTER_ERR exception and abort these steps. [XML]
>
>    2.  Return a new Element node with no attributes, namespaceURI set
> to "http://www.w3.org/1999/xhtml", prefix set to null, localName set
> to tagName, converted to lowercase, and ownerDocument set to the
> context node. "
>
> Thus a new localName is always lower case?

Yes.


> Compare http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html which
> says at 1.1.6. (Case sensitivity in the DOM):
>
> "The DOM has many interfaces that imply string matching. HTML
> processors generally assume an uppercase (less often, lowercase)
> normalization of names for such things as elements, while XML is
> explicitly case sensitive. "
>
> Is this difference intended?

It seems pointless to preserve case in XML documents but fold to lowercase in text/html.


Cheers,
-- 
Simon Pieters
Opera Software
Received on Tuesday, 14 April 2009 09:43:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:18:21 GMT