W3C complience checker and conformance

E

EN

So,

I have Visual Studio 2005 and did some HTML makeup, I hired a designer to do
the graphics, and after that, I check my site on conformance.

Guess what? Visual Studio sais: everything OK, but W3C says that
<link> tags should not be closed by /> (empty tag) nor by </link> so a <link
[tags]> should stay as it is.

instead it wants a <meta> tag to be closed by </meta> and not by /> (empty
tag)

I must say, Visual Studio is consequent, it votes for closing through />
(both the meta as the link tag).

So guys and girls, is W3C kidding or what? If I stick to conformance, I get
a very inconsequent non-xhtml of the contents of the <head> tag... but W3C
validates it as OK.
 
J

Jim Higson

EN said:
So,

I have Visual Studio 2005 and did some HTML makeup, I hired a designer to
do the graphics, and after that, I check my site on conformance.

Guess what? Visual Studio sais: everything OK, but W3C says that
<link> tags should not be closed by /> (empty tag) nor by </link> so a
<link
[tags]> should stay as it is.

the /> closing is for CHTML. Maybe you're using HTML?
instead it wants a <meta> tag to be closed by </meta> and not by /> (empty
tag)

I must say, Visual Studio is consequent, it votes for closing through />
(both the meta as the link tag).

Suprising given that Microsoft's browser doesn't support XHTML.
So guys and girls, is W3C kidding or what? If I stick to conformance, I
get a very inconsequent non-xhtml of the contents of the <head> tag... but
W3C validates it as OK.

If you want the document to be HTML, close using </foo>
If you want the document to be XHTML, you can use either.

If you don't want your code mangled, use a different editor.
 
D

David Dorward

EN said:
Guess what? Visual Studio sais: everything OK, but W3C says that
<link> tags should not be closed by /> (empty tag) nor by </link> so a
<link
[tags]> should stay as it is.

instead it wants a <meta> tag to be closed by </meta> and not by /> (empty
tag)
So guys and girls, is W3C kidding or what?

Depends if you are working in XHTML or HTML. In HTML <link> and <meta> are
correct, while in XHTML <link />, <link></link> and <link/> (ditto meta)
are correct - although only one is allowed under Appendix C guidelines
(although XHTML as text/html is silly anyway - as has been discussed many
times before in this newsgroup).

I've never see the W3C Markup Validator get this wrong though.

A URL would be helpful.
 
D

David Dorward

Jim said:
If you want the document to be HTML, close using </foo>

No, don't.

The META element
Start tag: required, End tag: forbidden
http://www.w3.org/TR/html4/struct/global.html#h-7.4.4

Document relationships: the LINK element
Start tag: required, End tag: forbidden
http://www.w3.org/TR/html4/struct/links.html#h-12.3
If you want the document to be XHTML, you can use either.

Not if you plan to serve as text/html
http://www.w3.org/TR/xhtml1/#C_2
http://www.w3.org/TR/xhtml1/#C_3
 
J

Jim Higson

Jim said:
EN said:
So,

I have Visual Studio 2005 and did some HTML makeup, I hired a designer to
do the graphics, and after that, I check my site on conformance.

Guess what? Visual Studio sais: everything OK, but W3C says that
<link> tags should not be closed by /> (empty tag) nor by </link> so a
<link
[tags]> should stay as it is.

the /> closing is for CHTML. Maybe you're using HTML?

Oops. The X and C keys are right next to each other.
 
I

ironcorona

David said:
EN said:
Guess what? Visual Studio sais: everything OK, but W3C says that
<link> tags should not be closed by /> (empty tag) nor by </link> so a
<link
[tags]> should stay as it is.

instead it wants a <meta> tag to be closed by </meta> and not by /> (empty
tag)

As far as I remember:
There is no </meta> tag. <meta> is an empty tag and only has
Depends if you are working in XHTML or HTML. In HTML <link> and <meta> are
correct, while in XHTML <link />, <link></link> and <link/>

As above for <meta>. There is no </link> tag.
HTML: <link>
XHTML: <link />
 
J

Jim Higson

David said:
No, don't.

The META element
Start tag: required, End tag: forbidden
http://www.w3.org/TR/html4/struct/global.html#h-7.4.4

Document relationships: the LINK element
Start tag: required, End tag: forbidden
http://www.w3.org/TR/html4/struct/links.html#h-12.3

Ok. It'd been so long since I'd coded using HTML.

The debate continues...

My argument is that as an optimist I like to code for the good browsers and
then do what I can to make up for deficiencies in the bad one. In this case
that means sending XHTML with the correct MIME type to everything except
IE. Just like I send standards-compliant CSS to everything but IE.

Anyway, the arguments about not serving XHTML as text/html are good ones,
but my preference is to fall back on parsing tolerance in the crusty
non-xhtml browser rather than worry about having to convert all my pages to
XHMTL in the future.
 
I

ironcorona

Jim said:
The debate continues... [...]
Anyway, the arguments about not serving XHTML as text/html are good ones,
but my preference is to fall back on parsing tolerance in the crusty
non-xhtml browser rather than worry about having to convert all my pages to
XHMTL in the future.

What is the argument? I'm new to this group.
 
I

ironcorona

EN said:
So,

I have Visual Studio 2005 and did some HTML makeup, I hired a designer
to do the graphics, and after that, I check my site on conformance.

Guess what? Visual Studio sais: everything OK, but W3C says that
<link> tags should not be closed by /> (empty tag) nor by </link> so a
<link [tags]> should stay as it is.

Perhaps you have a problem with your DTD? It looks to me as if Visual
Studio is writing the code as XHTML but is using the HTML 4.1 doctype
instead it wants a <meta> tag to be closed by </meta> and not by />
(empty tag)

There is no said:
So guys and girls, is W3C kidding or what? If I stick to conformance, I
get a very inconsequent non-xhtml of the contents of the <head> tag...
but W3C validates it as OK.

I think that Larry Wall's rules about Perl apply here (slightly modified):

#1

[W3C] is always by definition right about how
HTML:
 should behave. This
means [it] has final veto power [...].

#2

[W3C] is allowed to change [its] mind about any matter at a later date,
regardless of whether [it] previously invoked Rule 1.

:)
 
E

EN

Jim Higson said:
EN said:
So,

I have Visual Studio 2005 and did some HTML makeup, I hired a designer to
do the graphics, and after that, I check my site on conformance.

Guess what? Visual Studio sais: everything OK, but W3C says that
<link> tags should not be closed by /> (empty tag) nor by </link> so a
<link
[tags]> should stay as it is.

the /> closing is for CHTML. Maybe you're using HTML?
instead it wants a <meta> tag to be closed by </meta> and not by />
(empty
tag)

I must say, Visual Studio is consequent, it votes for closing through />
(both the meta as the link tag).

Suprising given that Microsoft's browser doesn't support XHTML.

why do you think that? IE6 has no problems, and IE7 works fluently too.
I tried IE6 on Windows 2000 and NT4 as well and it just works on my xhtml
compliant site.

If you want the document to be HTML, close using </foo>
If you want the document to be XHTML, you can use either.

If you don't want your code mangled, use a different editor.

True, I just can ignore the message.
 
E

EN

David Dorward said:
No, don't.

The META element
Start tag: required, End tag: forbidden
http://www.w3.org/TR/html4/struct/global.html#h-7.4.4

Document relationships: the LINK element
Start tag: required, End tag: forbidden
http://www.w3.org/TR/html4/struct/links.html#h-12.3

But the links above are for the html 4.0 standard.

I just conclude, that I'll stick to the general xhtml requirement, as I read
at w3c that all tags needs to be closed, so I conclude that is including
<link> and <meta>
 
D

David Dorward

Jim said:
The debate continues...

OK, there is /some/ debate here[1]. Appendix C is pretty badly written. A
normative part of the spec requires you to follow Appendix C before serving
XHTML 1.0 as text/html, and then Appendix C is marked as Informative and
phrased with such lovely language as "you may want to avoid".

On the other hand saying: "You absolutely must do everything in this list of
things to do. Start of list. End of list." is plain silly, so I don't
favour that interpretation.

But that doesn't have anything to do with the points you raise below at all,
nor does it cover my point - which is that when serving as text/html there
is NO choice between said:
My argument is that as an optimist I like to code for the good browsers
and then do what I can to make up for deficiencies in the bad one. In this
case that means sending XHTML with the correct MIME type to everything
except IE. Just like I send standards-compliant CSS to everything but IE.

The only browser I've done any serious poking at regarding XHTML support is
Firefox (you might have heard of it, it is quite popular). Its (basic)
XHTML support is far behind its HTML support (no incremental rendering, no
document.write, its only just regained innerHTML), and its FAQ for
developers recommends HTML 4.01 as text/html unless you are doing something
that actually needs XHTML (such as MathML).
Anyway, the arguments about not serving XHTML as text/html are good ones,
but my preference is to fall back on parsing tolerance in the crusty
non-xhtml browser rather than worry about having to convert all my pages
to XHMTL in the future.

I don't think it likely that there will be any such need to convert pages.

For a start, I suspect XHTML 1.x will to turn out to be a technological cul
de sac, and either XHTML 2.0 or WHATWGs HTML 5 turning out to be what
people tend to use in the future.

Secondly, there are going to be HTML 4.x and tag soup pages around for a
very long time indeed, so user agent support isn't going to go away anytime
soon.

And even if it does, converting from HTML 4.x to XHTML 1.x is fairly
trivial.

And even if you don't want to worry about doing that in the future, writing
XHTML 1.0 and converting it to HTML 4.01 before it gets to the client is
even more trivial (so trivial that I do it myself - XHTML is quite a nice
language, its just silly to serve it as text/html).


[1] I'm the only person I know who has ever argued that the spec doesn't
demand the following of the guidelines in Appendix C - and that was just to
show how badly written the spec is. I come does very firmly in favour of
following them if you are going to go with XHTML as text/html at all.
 
D

David Dorward

But the links above are for the html 4.0 standard.

HTML 4.01 actually, since you didn't specify which language you were using.
XHTML was covered later in the posting.
I just conclude, that I'll stick to the general xhtml requirement, as I
read at w3c that all tags needs to be closed, so I conclude that is
including <link> and <meta>

It does. Subject to the requirements of Appendix C.
 
D

David Dorward

EN said:
why do you think that? IE6 has no problems, and IE7 works fluently too.
I tried IE6 on Windows 2000 and NT4 as well and it just works on my xhtml
compliant site.

An HTTP resource served as text/html is supposed to be treated as tag soup
HTML, not as XHTML. Given a document served as application/xhtml+xml,
Internet Explorer will, by default, prompt the user to download it.
(Serving XHTML as text/html makes using XHTML pointless, and requires that
you follow the guidelines in Appendix C of the XHTML 1.0 spec ... which
depend on a bug in how the majority[1] of browsers handle <foo />). Search
an archive of newsgroup for the specifics.


[1] Not all, just the majority
 
J

Jim Higson

David Dorward wrote:

The only browser I've done any serious poking at regarding XHTML support
is Firefox (you might have heard of it, it is quite popular). Its (basic)
XHTML support is far behind its HTML support (no incremental rendering, no
document.write, its only just regained innerHTML), and its FAQ for
developers recommends HTML 4.01 as text/html unless you are doing
something that actually needs XHTML (such as MathML).

Don't want to do on about it too much, but document.write and innerHTML are
both pretty lousy ways of client-side scripting anyway. I do a lot of java
script and hadn't even noticed they were gone.
 
M

Mark Parnell

Deciding to do something for the good of humanity, ironcorona
As far as I remember:
There is no </meta> tag.

Not in HTML. In XHTML there is.
<meta> is an empty tag and only has
attributes.

Only in HTML - XHTML requires that *all* elements be closed. There are a
couple of ways of doing this, as David listed.
So in HTML <meta> is okay and in XHTML <meta /> it must be
closed properly.

And in XHTML </meta> is a perfectly valid way of closing it.

Ditto for </link>.
 
I

ironcorona

Mark said:
Deciding to do something for the good of humanity, ironcorona


Not in HTML. In XHTML there is.


Only in HTML - XHTML requires that *all* elements be closed. There are a
couple of ways of doing this, as David listed.


And in XHTML </meta> is a perfectly valid way of closing it.

Ditto for </link>.

Really? But they're empty! Is there an </img> tag too?
http://www.w3.org/TR/xhtml1/#guidelines
Just looked it up. You can do it because its part of XML but W3C seems
to be saying not to use it if at all possible.
 
N

Neredbojias

To further the education of mankind said:
David Dorward wrote:



Don't want to do on about it too much, but document.write and
innerHTML are both pretty lousy ways of client-side scripting anyway.
I do a lot of java script and hadn't even noticed they were gone.

I disagree highly with your take re. the document.write function. It's a
very facile and semantically-appropriate way to have pages gracefully
degrade for users without active javascript.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top