W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: getElementsByTagName() and case-sensitivity for HTML documents

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Mon, 30 Jul 2001 21:58:39 +0200
To: David Flanagan <david@oreilly.com>
Cc: www-dom@w3.org, bradford@dbxmlgroup.com, bob.foster@webgain.com, david-b@pacbell.net
Message-ID: <fgcbmtcagnh5bok0faclnh1igl9h24dnbf@4ax.com>
* David Flanagan wrote:
>> In an HTML dom, nothing is case sensitive.

Attribute and Element names are folded to lower case in the DOM, for
attribute values and text node content the HTML rules apply and there
are lot's of case-sensitive attribute values.

>But this isn't enough.  It just says that the processor normalizes all
>HTML element names to be uppercase or lowercase.

The tagName property is always returned in uppercase.

>This doesn't help me
>know what I should pass to getElementsByTagName().

Input isn't modified, at least, there is no such statement in DOM Level
2, so you must pass uppercase element names.

>In practice, I know that for HTML documents I can use tag names with any
>capitalization and the getElementsByTagName() methods will work okay.

Yes, if you pass uppercase element names.

My interpreation, I don't know if something else is intended.
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/
Received on Monday, 30 July 2001 15:59:30 GMT

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