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

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