PDA

View Full Version : W3c Confirmation



Dal
07-27-2008, 12:26 AM
So I really want to stick by the W3c stuff and have done so far, had large amounts of workarounds to do and so far happy to say everything conforms. However; (<-there always one of these everywhere I go)



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-gb" />
<title>Some Random Title</title>
</head>
<body>

<div>
<img src="/test.png" alt="test" />
</div>

</body>
</html>


Will pass the validator no problems all's good until I found something on w3.org which didnt add up;
http://www.w3.org/TR/REC-html40/struct/objects.html

Can you see every tag is written in capitals and to provide how bad this is just enter this code into the validator and you will see;



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-gb" />
<title>Some random title</title>
</head>
<body>

<div>
<IMG src="/test.png" alt="test" />
</div>

</body>
</html>


The validator can be found here; http://validator.w3.org/

So whats the score? Why would that have bad code on there?

Kind regards
Dal

Edited by ddadmin to remove page title, as requested

thetestingsite
07-27-2008, 12:31 AM
You are using an XHTML doctype and I believe (correct me if I'm wrong) that all tags in XML have to be lowercase. The page you linked to with the documentation is for HTML 4 and not XHTML:
http://www.w3.org/TR/xhtml1/

Hope this helps.

Dal
07-27-2008, 12:36 AM
Doh - I went off the path at some point and found this page, I didnt think to check what it was refering to. Oh well, I knew I had to keep it lowercase and when I saw all that horrible uppercase stuff I went off the handle. Im pleased now that I didnt go running off to the W3C forum and make a twit of myself, ... Ooops I kind of did this anyway here :*

Hey all this wasnt me, someone hijacked my account MOD! :D

Thanks for driving that one home thetestingsite :)
Kind regards
Dal

Twey
07-27-2008, 02:46 AM
You almost certainly shouldn't be using XHTML at this point. IE has no support for it, and as a result there is nothing to be gained and quite a bit to be lost from using it (if you intend to support IE). See http://www.webdevout.net/articles/beware-of-xhtml and http://www.hixie.ch/advocacy/xhtml for more details.

The document to which you linked was in and on HTML 4. HTML 4 is case-insensitive, and there is no recommendation governing the use of case: it is entirely up to the author's discretion. The W3C use capitals for many things in their standards, but that is not meant to be a universal convention, and many authors prefer using all lowercase in case the document should need to be transformed into some form of XML at some point.

Dal
07-27-2008, 03:18 AM
Ill keep a bookmark of them articles but Im unsure as to why XHTML is an issue. For a start IE doesnt work, no I mean its NOT W3C compliant and everyone knows that its a pain in the proverb.

Also this part was from the first arcticle but the website loads in gradual as if you would expect it too and no errors on any (IE7,IE8(beta),FF2,FF3,Safari 3.1.1,Opera (latest), Avant, and flock I know the last 2 are using IE and Gecko engine) If it wasnt supported or failed in any way then W3C wouldnt have a validation for it, Since the aim of the W3C is to recommend building practices they certainly wouldnt support what these articles claim.


Firefox and other problems
Up

Although Firefox supports the parsing of XHTML documents as XML when sent with the application/xhtml+xml content type, its performance in versions 2.0 and below is actually worse than with HTML. When parsing a page as HTML, Firefox will begin displaying the page while the content is being downloaded. This is called incremental rendering. However, when it's parsing XML content, Firefox 2.0 and below will wait until the entire page is downloaded and checked for well-formedness before any of the content is displayed. This means that, although in theory XML is supposed to be faster to parse than HTML, in reality these versions of Firefox usually display HTML content to the user much faster than XHTML/XML content. Thankfully, this issue is expected to be resolved in Firefox 3.0.


Thanks
Dal