473,811 Members | 3,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Document trailers : can anything legitimately follow </HTML>

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
9 2010
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

"Philip TAYLOR" <P.******@Rhul. Ac.Uk> wrote in message
news:10******** *****@news.supe rnews.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

"Chris Morris" <c.********@dur ham.ac.uk> wrote in message
news:87******** ****@dinopsis.d ur.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
"Harlan Messinger" <h.*********@co mcast.net> writes:
"Chris Morris" <c.********@dur ham.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
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
combinatio ns 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
Lachlan Hunt <la**********@l achy.id.au.inva lid> 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
Chris Morris wrote:
Lachlan Hunt <la**********@l achy.id.au.inva lid> 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
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
"Philip TAYLOR" <P.******@Rhul. Ac.Uk> a écrit dans le message de
news:10******** *****@news.supe rnews.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.publ ic.inetserver.i is I think ?)

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3237
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td> <td>..<tr>.<td> <td> </table>" content to
2
10572
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
1
1747
by: Papastefanos Serafeim | last post by:
I want to use the <xsl:document> XSLT command with xalan, but I get the following error message -------- XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException:javax.xml.transform.TransformerException: xsl:document is not allowed in this position in the stylesheet! -------- The same transformation works fine with saxon ! What should I do ?
3
2772
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed into a <xml> document but not sure which direction to take. Is there perhaps a starter document which uses sql server as the data source I can tap into.
1
2248
by: yawnmoth | last post by:
I'm trying to mess around with PHP5's DOM functions and have run into something that confuses me: <?php $dom = new DOMDocument(); $dom->loadHTML('<html></html>'); echo $dom->childNodes->length; ?>
5
3416
by: jhurrell | last post by:
I have been having some trouble getting my XSL style sheet to parse correctly. I have some XML outputted from an SQL-Server, that I then need to turn into multiple HTML files. This I have done with moderate success using Saxon and <xsl:result-document>, but Saxon is throwing an error and I don't know how to resolve it. Maybe someone can offer some advice? This is a long question, for which I apologise... OS= Windows XP Pro, Saxon=8.8 XML...
1
2253
by: John | last post by:
Hi var poster="<html><head..... etc .... </html>"; var animal='dog'; The string contains images and text that changes. Originally I wanted to do something like print "<a href=" + poster + ">Choose Poster of a " + animal + "</a>";
3
3390
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
3
5064
by: Petterson Mikael | last post by:
Hi, I was running the following in Netbeans 5.5: sing com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl - default JRE XSLT processor. Creating output/NcmiSigTest.java Unsupported XSL element 'http://www.w3.org/1999/XSL/Transform:document' Transformation finished.
0
9726
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10384
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10130
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6887
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5553
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.