RE: getElementsByTagName() in Mozilla HTML implementation

Note: Continuation of a thread started on www-dom-ts

--- Manos Batsis <m.batsis@bsnet.gr> wrote:
> 
> 
> > -----Original Message-----
> > From: Curt Arnold
> [mailto:curta_ontheroad@yahoo.com] 
> 
> 
> > The source HTML documents use all upper-case tag
> names
> > (the XHTML documents are valid XHTML so they use
> upper
> > case tag names).
> 
> Shouldn't that be lower case?
> 
That was a typo, tag names in XHTML are lower case.

> 
> > Microsoft IE does do this, so if I ask for
> > getElementsByTagName("a"), I'll also get any <A>
> > elements in the document.  Mozilla 0.9.8 will not.
> 
> Mozilla is correct (for XHTML) since 'a' and 'A' is
> not the same
> element; 'xhtml:A' does not exist.

Internet Explorer and Mozilla are both correctly case
sensitive for XML (and XHTML).  Their behavior differs
for HTML documents.  IE appears either to perform a
case-insensitive match on the tag name, Mozilla
performs a case-sensitive match.

The statements on case sensitivity on HTML
implementations in various documents appear to be
inconsistant:

Section 1.3 of the HTML DOM L2 Working Draft says
that:

The other thing is that when calling methods that are
case insensitive when used on a HTML document (such as
getElementsByTagName() and namedItem()) the string
that is passed in should be lower case to work on both
HTML and XHTML documents.

Section 1.1.7 of the DOM L2 Core states that string
comparisions are strictly binary and hence
case-sensitive.

Section  C.11 of the XHTML 1.0 says that the HTML DOM
that tagnames and attributes are returned uppercase.


Internet Explorer appears to conform to the behavior
alluded to in Section 1.3 of the HTML DOM 2 WD.
 Mozilla appears to be conforming to the behavior
implied by the other two sections.

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

Received on Wednesday, 6 February 2002 16:59:12 UTC