RE: getElementsByTagName() in Mozilla HTML implementation

On Wed, 2002-02-06 at 07:17, Manos Batsis wrote:
> 
> 
> > From: Manos Batsis 
> > 
> > > From: Curt Arnold [mailto:curta_ontheroad@yahoo.com] 
> 
> > > It would be good to confirm that the DOM spec does
> > > require case-insensitive behavior from
> > > getElementsByTagName and whether the issue can be
> > > fixed in Mozilla in a timely manner.
> > 
> > Mozilla behaves correctly. See [1] section 4.2.
> > 
> > [1] http://www.w3.org/TR/xhtml1/#diffs
> > 
> 
> Maybe not, [1] says "element type names exposed through a property are
> in uppercase", but what really confuses me is [2].

You forgot:
[[
For DOM Level 1 [HTML], the transitional and frameset DTDs for HTML 4.0
are assumed.
]]
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html#ID-1176245063

XHTML cannot me manipulated with the DOM Level 1 HTML. Have a look at
DOM Level 2 HTML in order to manipulate XHTML 1.0 documents.

Mozilla behaves correctly.

http://www.w3.org/2002/01/test/htmlorxml
http://www.w3.org/2002/01/test/htmlorxml2
http://www.w3.org/2002/01/test/htmlorxml3
will tell you if, depending on the mime type, the browser loads the DOM
tree correctly.

> Before reading the above, I was naive enough to think that a doctype
> declaration would be enough to define DOM behaviour....

HTML is a special since it is not XML, so the rules differ. If you
manipulate an HTML or an XHTML document using the DOM Level 2 HTML, the
rules will be different.

> If I understand correctly you are talking about HTML, not XHTML. So I
> guess [1] is correct in this case.

Yes, for HTML 4.0 documents.

Philippe

Received on Wednesday, 6 February 2002 09:38:57 UTC