Re: Web DOM Core - createElement(tagName)

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 UTC