[thelist] Confused - how does all this fit together ?

Hendrik Schwachenwalde come2los at yahoo.ca
Fri Dec 3 15:45:01 CST 2004


Hi there,
this is my first post to this list - so please, be
gentle. I have been reading for a week now about all
kinds of User Agents being able to render all kinds of
documents (HTML tag soup, HTML4, XHTML1.x, ..) as
specified by MIME types, document sniffing, file
extensions, etc.
I am familiar with XML, XSLT, and of course the old
tag soup. As of now I am still very confused how all
of this fits together, mainly because I cannot find
any good description that takes a top down approach to
web publishing. I am sure it is out there - I just
haven't found it yet. This is what I have pieced
together so far (including some assumptions that may
or may not be right):

1. - All webpages are rendered by User Agents that
always provide either a 'window' or a 'frame' object
to be used as a container for the webpage. This object
always contains the 'document' object which represents
the webpage to be rendered.

2. - The document rendered is considered to be of a
certain document type which depends on the MIME type
(if the document was served by a webserver), or the
file extension (if the document resides on a
filesystem), and/or the DOCTYPE declaration at the top
of the document.

3. - The document to be rendered can be accessed using
the appropriate DOM Level. Which DOM Level is
appropriate depends on the document type.

4. - The rendering process can be influenced by the
use of CSS stylesheets. Depending on the document type
there are slight differences to be considered.

5. - Each 'window' or 'frame' is associated with it's
own Global JavaScript object which can hold multiple
XML DOM objects (created by
document.implementation.createDocument()).
  Note: I am not really sure what controls which of
the documents is being rendered.

Based on these assumptions I tried to start with a
simple document of the strictest type:

-test.xhtml-------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en"><head><title>xdom</title><script
type="text/javascript" src="xdom.js"></script>
<link rel="stylesheet" type="text/css"
href="test.css"></link></head><body>&#xa0;</body></html>

-xdom.js--------------------------------------------

function js_main(){
alert(document.getElementsByTagName('body').length);
}
window.onload=js_main;

-----------------------------------------------------

But already I hit a roadblock. When I open the file
'test.xhtml' in Mozilla 1.6 the HTMLCollection 'body'
reports a length of '0' whereas IE6.0 reports '1'!
Page info in Mozilla tells me that the Render Mode is:
"Standards compliance mode".

IF my assumptions are right it should work in both
browsers.

What am I doing wrong?



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 


More information about the thelist mailing list