473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 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 3330
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cezary | last post by:
Hello. I was read PHP manual, but i'm not sure yet. Here is my meta tags in html: <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-2"> <META HTTP-EQUIV="Expires"...
1
by: sionvalais | last post by:
Is it possible to prevent caching of images on a website when one uses xhtml strict? cheers, Mark
1
by: Darren Blackley | last post by:
Hi there I have documents that I want to automatically add additional meta tags to. The documents already have some meta tags and I want to keep them all together, so I want to add my new meta tags...
19
by: Christian Hvid | last post by:
Hello groups. I have a series of applet computer games on my homepage: http://vredungmand.dk/games/erik-spillet/index.html http://vredungmand.dk/games/nohats/index.html...
21
by: Zenobia | last post by:
I can't understand the warning I'm getting from the W3C validator. Here it is, along with the source code that it is not fully satisfied with. What meta-tags should I be including? Here is the...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
16
by: Edward | last post by:
Hi All, I am having huge problems with a very simple dotnet framework web page (www.gbab.net/ztest3.aspx) , it does NOT render correctly under Apple's Safari. The DIV's do not align amd float as...
6
by: docbook.xml | last post by:
I have the following in the XHTML 1.0 Strict page: <meta http-equiv="Content-Type" content="text/html;charset=utf-32" /> However W3 validator complains that "The character encoding specified in...
5
by: Candoer | last post by:
All I have the following meta tags on every page of my web site (www.candoer.org). Are they necessary on every page or only on the index page? <meta name="robot" content="noindex; nofollow">...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.