471,102 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,102 software developers and data experts.

Validator (4.01 strict) doesn't like my meta tags

Hi,

The W3C validator tells me this page isn't valid HTML 4.01 Strict:

http://www-student.cs.york.ac.uk/~jb..._validate.html

The reason it gives is I've closed meta tags with a '/'
("character data is not allowed here")

e.g.

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
If I remove the '/' the validator no longer complains.

How is it, then, that the '/' character *is* permitted at the end of an img
tag?

e.g.

<img height="31" width="88" alt="Valid CSS!" src="valid-css.png" />
Is this a bug in the validator, or an inconsistency in the DTD, or am I
being stupid?

Thanks,

Barney
By the way, if you look at the source for the wont_validate.html page and
think it looks horrid, I agree. The page was generated by WASH, an Embedded
Domain Specific Language which sits on top of the functional programming
language Haskell. WASH is supposed to guarantee elementary validity.

Jul 20 '05 #1
11 3200
Barney Norris wrote:

The W3C validator tells me this page isn't valid HTML 4.01 Strict:

http://www-student.cs.york.ac.uk/~jb..._validate.html

The reason it gives is I've closed meta tags with a '/' ("character
data is not allowed here")

<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1" />

If I remove the '/' the validator no longer complains.
That slash shouldn't be there. That is used in xhtml, but your
document is html.
How is it, then, that the '/' character *is* permitted at the end
of an img tag?
IIRC, the slash actually closes the element, so the next character
should be considered data, although no browsers actually do that. If
I'm wrong, someone will be along shortly to tell me. I've never
played with xhtml, and frankly don't see a reason to, so I've never
really looked at syntactical differences.
By the way, if you look at the source for the wont_validate.html
page and think it looks horrid, I agree.


I don't think it looks horrid. It looks quite reasonable, especially
compared to most pages generated by so-called wysiwy web authoring tools.

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

Jul 20 '05 #2
"Barney Norris" <us****@narney.net> wrote:
The W3C validator tells me this page isn't valid HTML 4.01 Strict:

http://www-student.cs.york.ac.uk/~jb..._validate.html

The reason it gives is I've closed meta tags with a '/'
("character data is not allowed here")

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
That is invalid HTML but valid XHTML. Either remove the slash or
change the document to XHTML.
How is it, then, that the '/' character *is* permitted at the end of an img
tag?

<img height="31" width="88" alt="Valid CSS!" src="valid-css.png" />


Under SGML rules code such as <img /> or <meta /> is actually a short
form of <img></img>> or <meta></meta>>. Note the extra > at the end.
In the <head> section of the page that > is not permitted ("character
data not allowed here") but in <body> section that > is treated as
part of the content.

Browsers almost universally get this wrong and never display the >
which is why you can use the <img /> formulation to pass XHTML off as
HTML to unsuspecting browsers.

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
Thanks for your reply.

Brian wrote...
That slash shouldn't be there. That is used in xhtml, but your
document is html.


I understood it to be an XHTML thing, but reasoned it must be permitted in
HTML 4 since WASH produced it as HTML 4 output (the DOCTYPE included). It
must be a problem with the WASH library.
By the way, if you look at the source for the wont_validate.html
page and think it looks horrid, I agree.


I don't think it looks horrid. It looks quite reasonable, especially
compared to most pages generated by so-called wysiwy web authoring tools.


I know you're not implying you think WASH is a WYSIWYG web authoring tool.
But I'm keen to show people it's not. The Haskell source code for the
wont_validate page (extra to the WASH library) is available here if you're
interested to know what the EDSL looks like.

http://www-student.cs.york.ac.uk/~jban100/procLinks2.hs

(The Haskell script builds the page in question, also generating the list of
links from a simple text file.)

I think I will probably switch to producing XHTML mark-up with WASH. WASH
can give stronger guarantees for validity with XHTML than with HTML. The
mark-up as it stands is actually very close to being valid XHTML 1.1 anyway.

--
Barney
Jul 20 '05 #4
On Sun, 16 Nov 2003 23:04:23 -0000, "Barney Norris"
<us****@narney.net> wrote:
Hi,

The W3C validator tells me this page isn't valid HTML 4.01 Strict:

http://www-student.cs.york.ac.uk/~jb..._validate.html

The reason it gives is I've closed meta tags with a '/'
("character data is not allowed here")

e.g.

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

[...]

You should take a look at this document:

<http://www.cs.tut.fi/~jkorpela/html/empty.html>

and this related document:

<http://www.cs.tut.fi/~jkorpela/qattr.html>

Nick

--
Nick Theodorakis
ni**************@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
Jul 20 '05 #5
Steve Pugh wrote ...
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"
/>
That is invalid HTML but valid XHTML. Either remove the slash or
change the document to XHTML.
I reckon changing to XHTML will be easier. I have a feeling the WASH
library may make the assumption that all tags have to be closed. It's an
experimental thing. Maybe it's never been tested with meta tags.
Under SGML rules code such as <img /> or <meta /> is actually a short
form of <img></img>> or <meta></meta>>. Note the extra > at the end.
In the <head> section of the page that > is not permitted ("character
data not allowed here") but in <body> section that > is treated as
part of the content.

Browsers almost universally get this wrong and never display the >
which is why you can use the <img /> formulation to pass XHTML off as
HTML to unsuspecting browsers.


Thanks for your explanation. It makes sense. One question... when would
<tag></tag>> ever get used?

--
Barney
Jul 20 '05 #6
I wrote ...
Thanks for your explanation. It makes sense. One question... when would
<tag></tag>> ever get used?


No need to answer that. This document has, I think, answered my question.

http://www.cs.tut.fi/~jkorpela/qattr.html

--
Barney
Jul 20 '05 #7
Nick Theodorakis wrote ...
You should take a look at this document:

<http://www.cs.tut.fi/~jkorpela/html/empty.html>

and this related document:

<http://www.cs.tut.fi/~jkorpela/qattr.html>

Nick


Thanks. They were worth a read.
Jul 20 '05 #8
Barney Norris wrote:

I understood it to be an XHTML thing, but reasoned it must be permitted in
HTML 4 since WASH produced it as HTML 4 output (the DOCTYPE included).
You can't trust tools, I'm afraid, unless you are already familiar
with them.
By the way, if you look at the source for the wont_validate.html
page and think it looks horrid, I agree.


I don't think it looks horrid. It looks quite reasonable, especially
compared to most pages generated by so-called wysiwy web authoring tools.


I know you're not implying you think WASH is a WYSIWYG web authoring tool.


Correct, I am not implying anything about WASH because I am unfamiliar
with it. And I'm afraid the link you provided doesn't help me,
because I am unfamiliar with the the script language.
But I'm keen to show people it's not.
I can't imagine why. Noone has claimed that it is WYSIWYG; noone has
claimed anything about it. If you like it, and it meets your needs,
then by all means go on using it. :)
I think I will probably switch to producing XHTML mark-up with WASH. WASH
can give stronger guarantees for validity with XHTML than with HTML. The
mark-up as it stands is actually very close to being valid XHTML 1.1 anyway.


I can't comment on this other than to say that, for most users, HTML
4.01 (strict) is the best choice right now. XHTML presents difficult
problems for the author. However, your needs might require it. Good
luck.

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

Jul 20 '05 #9
Brian wrote ...
Correct, I am not implying anything about WASH because I am unfamiliar
with it. And I'm afraid the link you provided doesn't help me,
because I am unfamiliar with the the script language.
I previously wrote... The Haskell source code for the
wont_validate page (extra to the WASH library) is available here if you're
interested to know what the EDSL looks like.
Important words being "if you're interested"

Because if you were interested, you could have plugged Haskell into your
search engine of choice and found this page
http://haskell.org can tell you all about the Haskell functional programming
language. And this one
http://www.informatik.uni-freiburg.d.../haskell/WASH/ is about WASH.

Perhaps you weren't interested? (Why would you be? I can't imagine.) No
problem... Then the link I provided was not intended to "help you."

But I'm keen to show people it's not.


I can't imagine why.


Fair enough.

Noone has claimed that it is WYSIWYG; noone has
claimed anything about it. If you like it, and it meets your needs,
then by all means go on using it. :)
Again, if you're interested, then by all means, read on...

I don't (yet) like it. I dislike it. I'm using it because I need to for an
academic project. I have to produce interactive web pages for haskell.org
using the Haskell programming language (I guess it will be another working
example of the versatility of Haskell). Using WASH *should* make documents
inherently well-formed and weakly valid by design (an admirable aim, surely)
and permit abstractions of commonly used patterns. I am also going to build
the web site to the same specification using a more conventional tool (PHP,
for example), and make a comparison of the process and results.

...> for most users, HTML 4.01 (strict) is the best choice right now. XHTML presents difficult
problems for the author. However, your needs might require it. Good
luck.


Thanks, and thanks for your time. I get the impression I've caused you
great irritation. That wasn't my intention.

--
Barney

Jul 20 '05 #10
On Sun, 16 Nov 2003, Barney Norris wrote:
http://www-student.cs.york.ac.uk/~jb..._validate.html
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />


Since your server is Apache, you do not need this http-equiv ersatz at all.
Specify the encoding ("charset") via the HTTP header:
http://www.w3.org/International/O-HTTP-charset.html
http://ppewww.ph.gla.ac.uk/~flavell/...t/ns-burp.html

Jul 20 '05 #11
Barney Norris wrote:
Brian wrote ...
Correct, I am not implying anything about WASH because I am
unfamiliar with it. And I'm afraid the link you provided doesn't
help me, because I am unfamiliar with the the script language.
I previously wrote...
The Haskell source code for the wont_validate page (extra to the
WASH library) is available here if you're interested to know what
the EDSL looks like.


Important words being "if you're interested"


I wasn't trying to be a smart-a.., honest. I was simply informing you
of my limitations.
HTML 4.01 (strict) is the best choice right now. XHTML presents
difficult problems for the author. However, your needs might
require it.


Thanks, and thanks for your time.


For what little I offered, you are most welcome. :) Note that, if
you do not already know about problems with xhtml and uas, especially
MSIE, you might want to look into it. A Google search in the ciwah
group should produce lots of results.
I get the impression I've caused you great irritation.


And I was going to say the same thing, that I've caused you some
irritation. The problem with usenet, like email, is the loss of
meaning expressed in body language, vocal tone, etc.

Good luck with your project.

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

Jul 20 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Cezary | last post: by
1 post views Thread by sionvalais | last post: by
1 post views Thread by Darren Blackley | last post: by
19 posts views Thread by Christian Hvid | last post: by
21 posts views Thread by Zenobia | last post: by
24 posts views Thread by Day Bird Loft | last post: by
16 posts views Thread by Edward | last post: by
5 posts views Thread by Candoer | last post: by

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.