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

Content-Type not a reserved name?

P: n/a

I'm trying to validate a page that begins with:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.did>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
....
which fails at this line with:

"CONTENT-TYPE" is not a reserved name

Can anyone help me? TIA.

D.

Dennis M. Straussfogel, Ph.D.
Aerospace Engineering Consultant
Jul 20 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Dennis M. Straussfogel wrote:
I'm trying to validate a page that begins with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.did>
a typo: loose.dtd (not loose.did)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


The syntax is wrong. You should not have /> at the end (that' xhtml
syntax, but your document is html). More importantly, you should set
the content type and charset using real http headers. A search on
Google produced the following document authored by Alan Flavell:

http://ppewww.ph.gla.ac.uk/~flavell/...t/ns-burp.html

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

P: n/a
dm*@bcgroup.net (Dennis M. Straussfogel) wrote:
I'm trying to validate a page that begins with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.did>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

which fails at this line with:

"CONTENT-TYPE" is not a reserved name


You're missing a " at the end of the URL in the doctype. Hence the
validator sees something like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"long string" Content-Type" content="text/html; charset=iso-8859-1" />

The next problem will be the XHTML <meta /> in an HTML document. Never
use that last / in empty elements in HTML, only in XHTML.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3

P: n/a
In article <dm******************@news.abccom.bc.ca>, one of infinite monkeys
at the keyboard of dm*@bcgroup.net (Dennis M. Straussfogel) wrote:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

which fails at this line with:

"CONTENT-TYPE" is not a reserved name


Huh? Whatever tool reported that as a "fail" is talking nonsense.

But Brian's followup makes some valid points you should note.

--
Nick Kew
Jul 20 '05 #4

P: n/a
On Sat, 17 Jan 2004 20:15:44 GMT, Brian
<us*****@julietremblay.com.invalid-remove-this-part> wrote:
Dennis M. Straussfogel wrote:
I'm trying to validate a page that begins with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.did>
a typo: loose.dtd (not loose.did)


I think that causes the later error.
The syntax is wrong. You should not have /> at the end (that' xhtml
syntax, but your document is html).


AFAIK, it should still validate as HTML 4 with the _/>.
Jul 20 '05 #5

P: n/a
Neal wrote:
AFAIK, it should still validate as HTML 4 with the _/>.


No, it shouldn't.

<link ... /> is equiv to <link ... >&gt;

While you can have characters in the <body> section of the document (thus
<br /> being valid HTML 4.01 that looks horrible if it does what is
_should_ do), you can't in the <head> section.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #6

P: n/a
On Sat, 17 Jan 2004, Neal wrote:
The syntax is wrong. You should not have /> at the end (that' xhtml
syntax, but your document is html).

Indeed.
AFAIK, it should still validate as HTML 4 with the _/>.


Please explain.
Jul 20 '05 #7

P: n/a
Many thanks to all of you. I've embarrassed enough people finding their
stupid typos, that it's only fair turn about for my face to be duely
reddened. Sorry.

BTW, the " />" at the end was added as a "grasping at straws" attempt of
solution. I guess I also overfocused on the statement flagged as the error
and didn't look closely enough at the one(s) preceding it. (Really. I do
know better!)

Another question: In attempting to solve the problem, I did add an
..htaccess file to my root directory with the directive

AddType "text/html; charset=iso-8859-1" html

which should specify the charset for files with the .html extension. Will
this also specify for .shtml extensions as well, or do I need a second
directive line with "shtml" at the end? TIA--again.

D.

Dennis M. Straussfogel, Ph.D.
Aerospace Engineering Consultant
Jul 20 '05 #8

P: n/a
dm*@bcgroup.net (Dennis M. Straussfogel) wrote:
Another question: In attempting to solve the problem, I did add an
.htaccess file to my root directory with the directive

AddType "text/html; charset=iso-8859-1" html

which should specify the charset for files with the .html extension. Will
this also specify for .shtml extensions as well,
No.
or do I need a second directive line with "shtml" at the end?


Or more simply just add shtml to the end of the line above.
AddType "text/html; charset=iso-8859-1" html shtml

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #9

P: n/a
In article <84********************************@4ax.com>, Steve Pugh
<st***@pugh.net> wrote:
dm*@bcgroup.net (Dennis M. Straussfogel) wrote:
Another question: In attempting to solve the problem, I did add an
.htaccess file to my root directory with the directive

AddType "text/html; charset=iso-8859-1" html

which should specify the charset for files with the .html extension. Will
this also specify for .shtml extensions as well,


No.
or do I need a second directive line with "shtml" at the end?


Or more simply just add shtml to the end of the line above.
AddType "text/html; charset=iso-8859-1" html shtml

Steve


Thanks, Steve. And finally (I promise) can I delete the META tag
altogether if the charset is specified in the .htaccess file?

Dennis M. Straussfogel, Ph.D.
Aerospace Engineering Consultant
Jul 20 '05 #10

P: n/a
It seems "Dennis M. Straussfogel" wrote in
comp.infosystems.www.authoring.html in article <dms-
17**************@news.abccom.bc.ca>:
Thanks, Steve. And finally (I promise) can I delete the META tag
altogether if the charset is specified in the .htaccess file?


I'm not Steve, but the answer is an emphatic "you can, and you
should".

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #11

P: n/a
On Sat, 17 Jan 2004 22:42:34 +0000, David Dorward <do*****@yahoo.com>
wrote:
Neal wrote:
AFAIK, it should still validate as HTML 4 with the _/>.


No, it shouldn't.

<link ... /> is equiv to <link ... >&gt;


Ya, you're right. I'll buy the donuts tomorrow.
Jul 20 '05 #12

P: n/a
Stan Brown:
It seems "Dennis M. Straussfogel" wrote in
comp.infosystems.www.authoring.html in article <dms-
17**************@news.abccom.bc.ca>:
Thanks, Steve. And finally (I promise) can I delete the META tag
altogether if the charset is specified in the .htaccess file?

I'm not Steve, but the answer is an emphatic "you can, and you
should".


Maybe. One should however be aware that if a user saves such a page to
his own disc, the info about content-type and encoding will no longer be
present. If the same info is also included in a "meta" element in the
page, that will help a browser that reads the same file from disc.

That's the reason why e.g. Yukka does include a "meta" element with
content-type and encoding in his pages, although his server (of course)
sends the same info in the http header.

If Yukka does it, it can't be all that wrong, can it?

--
Bertilo Wennergren <be******@gmx.net> <http://www.bertilow.com>
Jul 20 '05 #13

P: n/a
It seems "Dennis M. Straussfogel" wrote in
comp.infosystems.www.authoring.html in article <dms-
17**************@news.abccom.bc.ca>:
Thanks, Steve. And finally (I promise) can I delete the META tag
altogether if the charset is specified in the .htaccess file?
Stan Brown:
I'm not Steve, but the answer is an emphatic "you can, and you
should".

It seems "Bertilo Wennergren" wrote in
comp.infosystems.www.authoring.html in article
<bu*************@news.t-online.com>:Maybe. One should however be aware that if a user saves such a page to
his own disc, the info about content-type and encoding will no longer be
present. If the same info is also included in a "meta" element in the
page, that will help a browser that reads the same file from disc.
I stand corrected. I was thinking only about the published version.
That's the reason why e.g. Yukka does include a "meta" element with
content-type and encoding in his pages, although his server (of course)
sends the same info in the http header.

If Yukka does it, it can't be all that wrong, can it?


:-)

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.