By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,766 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,766 IT Pros & Developers. It's quick & easy.

Document trailers : can anything legitimately follow </HTML>

P: n/a
Configuring a new instance of IIS, I noticed that it
allows an HTML-formatted document trailer to be appended
to every document served. Unfortunately, on checking
its behaviour, I find that it appends the trailer
/after/ the closing </HTML> of the document, separated
by a blank line. I therefore have a few questions :

1) Assuming HTML 4.01 Transitional, can anything
legitimately follow the closing </HTML> tag ?

2) If so, can this be a container with text that
a browser would be expected or required
to display ?

or

Can this be a comment which a browser is not
required or expected to display, but which
could be read if a visitor went into source
view ?

3) Is it possible to generalise the answers to the
above so that no matter which DTD is used,
the material following the closing </HTML>
tag is still legal and capable of being
read in some way (when I say "no matter which
DTD", I restrict myself to those currently
promulgated by the W3C, i.e., the HTML 4.01
family (frameset, strict and transitional),
and the XHTML family).

Philip Taylor, RHBNC
Jul 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Philip TAYLOR <P.******@Rhul.Ac.Uk> writes:
Configuring a new instance of IIS, I noticed that it
allows an HTML-formatted document trailer to be appended
to every document served. Unfortunately, on checking
its behaviour, I find that it appends the trailer
/after/ the closing </HTML> of the document, separated
by a blank line. I therefore have a few questions :

1) Assuming HTML 4.01 Transitional, can anything
legitimately follow the closing </HTML> tag ?
Yes.
2) If so, can this be a container with text that
a browser would be expected or required
to display ?
No. Though many browsers *do* display elements that appear after the
end of the </HTML> element, this can't be relied on.
Can this be a comment which a browser is not
required or expected to display, but which
could be read if a visitor went into source
view ?


Yes. You can also have as much whitespace as you like after the end of
the HTML element.

So basically you're limited to comments, whitespace scripts, and
combinations of the two.

--
Chris
Jul 20 '05 #2

P: n/a

"Philip TAYLOR" <P.******@Rhul.Ac.Uk> wrote in message
news:10*************@news.supernews.com...
Configuring a new instance of IIS, I noticed that it
allows an HTML-formatted document trailer to be appended
to every document served. Unfortunately, on checking
its behaviour, I find that it appends the trailer
/after/ the closing </HTML> of the document, separated
by a blank line. I therefore have a few questions :

1) Assuming HTML 4.01 Transitional, can anything
legitimately follow the closing </HTML> tag ?
No. However, you can put the </HTML> tag at the end of the trailer instead
of into the documents themselves. I don't happen to know *why* you would do
this, without a similar feature being offered for top of the document to
serve the same purpose.

2) If so, can this be a container with text that
a browser would be expected or required
to display ?

or

Can this be a comment which a browser is not
required or expected to display, but which
could be read if a visitor went into source
view ?

3) Is it possible to generalise the answers to the
above so that no matter which DTD is used,
the material following the closing </HTML>
tag is still legal and capable of being
read in some way (when I say "no matter which
DTD", I restrict myself to those currently
promulgated by the W3C, i.e., the HTML 4.01
family (frameset, strict and transitional),
and the XHTML family).

Philip Taylor, RHBNC


Jul 20 '05 #3

P: n/a

"Chris Morris" <c.********@durham.ac.uk> wrote in message
news:87************@dinopsis.dur.ac.uk...
Philip TAYLOR <P.******@Rhul.Ac.Uk> writes:
Configuring a new instance of IIS, I noticed that it
allows an HTML-formatted document trailer to be appended
to every document served. Unfortunately, on checking
its behaviour, I find that it appends the trailer
/after/ the closing </HTML> of the document, separated
by a blank line. I therefore have a few questions :

1) Assuming HTML 4.01 Transitional, can anything
legitimately follow the closing </HTML> tag ?
Yes.


???
2) If so, can this be a container with text that
a browser would be expected or required
to display ?
No. Though many browsers *do* display elements that appear after the
end of the </HTML> element, this can't be relied on.


Might that be because anything that follows the </HTML> tag is invalid and
therefore consistency of treatment, or any treatment at all, can't be
expected?
Can this be a comment which a browser is not
required or expected to display, but which
could be read if a visitor went into source
view ?
Yes. You can also have as much whitespace as you like after the end of
the HTML element.


Well, yes.

So basically you're limited to comments, whitespace scripts, and
combinations of the two.


What is a "whitespace script"? If you mean "script that produces white
space", you can't have a SCRIPT element outside of the HTML element.

Jul 20 '05 #4

P: n/a
"Harlan Messinger" <h.*********@comcast.net> writes:
"Chris Morris" <c.********@durham.ac.uk> wrote in message
Philip TAYLOR <P.******@Rhul.Ac.Uk> writes:
1) Assuming HTML 4.01 Transitional, can anything
legitimately follow the closing </HTML> tag ?


Yes.


???


He asked 'anything', not 'anything useful'.

Thinking about it a little, the obvious solution to the OP's problem
is to take the </body></html> off the end of each normal file, and
(optionally, given that this is HTML 4) put them on the end of the
IIS-included file.
2) If so, can this be a container with text that
a browser would be expected or required
to display ?


No. Though many browsers *do* display elements that appear after the
end of the </HTML> element, this can't be relied on.


Might that be because anything that follows the </HTML> tag is invalid and
therefore consistency of treatment, or any treatment at all, can't be
expected?


Exactly. I thought the 'No' made that clear enough.

Hmm. Given that the OP specified HTML rather than XHTML, do you know
of any browsers that will actually not display text after the </html>?
It'd be reasonable behaviour, but not one I've ever seen in practice.
So basically you're limited to comments, whitespace scripts, and
combinations of the two.


What is a "whitespace script"? If you mean "script that produces white
space", you can't have a SCRIPT element outside of the HTML element.


No, it's a script written in a language consisting entirely of white
space characters. A couple of them exist. I wouldn't expect a browser
to do anything with them, obviously (even inside an appropriate
<script> element), but you could put something even less obvious than
a comment after the </html>.

--
Chris
Jul 20 '05 #5

P: n/a
Chris Morris wrote:
Thinking about it a little, the obvious solution to the OP's problem
is to take the </body></html> off the end of each normal file, and
(optionally, given that this is HTML 4) put them on the end of the
IIS-included file.
You could also omit them enitrely, they are optional in HTML, though it
is good practice to use them. I don't recommend putting the end tags in
a seperate file — it's good practice to always finish every element in
the same file that it was started it. It helps to make sure that
elements don't inadvertently get opened or closed twice. I've seen
several sites that have several opening <html> tags that is most likely
because they didn't follow this guideline. (the only site I could
remember that did this has since been rebuilt, though it still doesn't
validate)
Hmm. Given that the OP specified HTML rather than XHTML, do you know
of any browsers that will actually not display text after the </html>?
It'd be reasonable behaviour, but not one I've ever seen in practice.


Current UAs display any textual content before or after the <html>
element. It's just completely invalid, though that won't stop most
people from doing it anyway. It is, however, more common to see extra
content before <html> rather than after </html>.
So basically you're limited to comments, whitespace scripts, and
combinations of the two.

Technically, I believe you can also have processing instructions. SGML
allows them just like XML, but they won't do anything useful (that I
know of) for any HTML UAs.
What is a "whitespace script"? If you mean "script that produces white
space", you can't have a SCRIPT element outside of the HTML element.


No, it's a script written in a language consisting entirely of white
space characters. A couple of them exist.


I know this is off topic, but I've never heard of any, can you give a
link to some examples? I looked, but could not find anything that even
remotely resembled a script entirely written in white space. Not even
the Hello World page [1] listed such a langage, though it has over 200
other languages.

[1] http://www2.latech.edu/~acm/HelloWorld.shtml

--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to ab***@127.0.0.1
Thank you.
Jul 20 '05 #6

P: n/a
Lachlan Hunt <la**********@lachy.id.au.invalid> writes:
Chris Morris wrote:
Thinking about it a little, the obvious solution to the OP's problem
is to take the </body></html> off the end of each normal file, and
(optionally, given that this is HTML 4) put them on the end of the
IIS-included file.
You could also omit them enitrely, they are optional in HTML, though
it is good practice to use them. I don't recommend putting the end


Wonder how much CSS-related stuff complains. Probably if the start
tags are there it'd be okay.
tags in a seperate file it's good practice to always finish every
element in the same file that it was started it. It helps to make


Hmm, I tend to have a header and footer include file. Differing
styles. One pass of the validator makes template mistakes fairly
obvious. I don't start things in main and end them in template,
though. As you say that's bad for maintainability.
What is a "whitespace script"? If you mean "script that produces white
space", you can't have a SCRIPT element outside of the HTML element.

No, it's a script written in a language consisting entirely of white
space characters. A couple of them exist.


I know this is off topic, but I've never heard of any, can you give a
link to some examples? I looked, but could not find anything that


http://compsoc.dur.ac.uk/whitespace/

http://compsoc.dur.ac.uk/whitespace/tutorial.html is an example of a
script embedded in a HTML file. (So what mime type should that have,
since it could equally well be a script with an embedded HTML file?)

There's also Acme::Bleach, which encodes Perl as whitespace, and I
think there's another whitespace language but I've lost the link.

--
Chris
Jul 20 '05 #7

P: n/a
Chris Morris wrote:
Lachlan Hunt <la**********@lachy.id.au.invalid> writes:
You could also omit them enitrely, they are optional in HTML, though
it is good practice to use them.


Wonder how much CSS-related stuff complains. Probably if the start
tags are there it'd be okay.


CSS is not affected by the presence of, or lack of optional start and/or
end tags in the source. CSS is only applied to the DOM after the
document has been parsed, so assuming the UA follows the HTML spec, and
builds the correct DOM, everything will work fine.

--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to ab***@127.0.0.1
Thank you.
Jul 20 '05 #8

P: n/a
On Sun, 8 Aug 2004, Lachlan Hunt wrote:
CSS is not affected by the presence of, or lack of optional start
and/or end tags in the source.


That's the theory. A pity that browser implementers often don't
apply the theory.

Jul 20 '05 #9

P: n/a
"Philip TAYLOR" <P.******@Rhul.Ac.Uk> a crit dans le message de
news:10*************@news.supernews.com
Configuring a new instance of IIS, I noticed that it
allows an HTML-formatted document trailer to be appended
to every document served. Unfortunately, on checking
its behaviour, I find that it appends the trailer
/after/ the closing </HTML> of the document, separated
by a blank line.


You can eventually re-develop the same functionnality with an ISAPI filter.
Not so difficult ! You should post to a microsoft IIS dedicated newsgroup
(microsoft.public.inetserver.iis I think ?)

Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.