homepage Welcome to WebmasterWorld Guest from 54.237.99.131
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

This 75 message thread spans 3 pages: < < 75 ( 1 2 [3]     
Why most of us should NOT use XHTML
DrDoc

WebmasterWorld Senior Member drdoc us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 12026 posted 7:39 pm on Apr 1, 2006 (gmt 0)

Ian Hickson, a member of the Mozilla.org Browser Standards Compliance QA team and an invited expert in the W3C CSS Working Group, explains why XHTML should not be sent as text/html: [hixie.ch...]

 

Wlauzon

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 12026 posted 1:32 am on Apr 19, 2006 (gmt 0)

If you are going to serve it all as text anyway, what is the point of calling it xhtml?

iaaa

5+ Year Member



 
Msg#: 12026 posted 4:57 pm on Apr 19, 2006 (gmt 0)

Wow.

That was an absolute shock; what is more shocking is if that people aren't lucky enough to bump on this thread, they will probably keep going again and again, blissfully unaware, using XHTML served as text/html being unaware of future consequences. The way I see it there are 3 options:

a) Continue using XHTML, served as text/html and wait for the judgement day, when and if it would be suitable to change to the xml doc type. As Ian Hickson points out there is a plethora of things that would break in this case.

b) Continue using XHTML, but change the content type to xml. Then IE is not happy with it. I can't remember seeing anything useful joint effort from MS lately apart from making its own technologies, and consistently ignoring anything that would lead towards standardisation and make peoples life easier. Personally I don't feel confident enough going ahead and fiddling with all the Apache web server's options in order to serve proper, pure XHTML as it was intended via the xml content type. It is not that I don't want to - I just don't know how!

c) 4.01 Strict: As the vast majority of people mentioned, it is probably is the way to go (or for those lucky enough that never changed it in first place).

I got a few associated queries that mostly derive from this thread and XHTML vs HTML in general:

a) Since in my mind, I think it would be stupid to have XHTML with the actual features of HTML (plus all the associated risks) would a possible solution be the 'fix' (pointed by DrDoc) at: [w3.org...]
Since, it is only IE that doesn't tend to follow the standards (and unfortunately the majority) would that cause any other problems?

Moving over to 4.01 Strict...

b) Would anyone dare to have a life expectancy for HTML 4.01?

c) Apart from keeping everything in lower case and generally coding in 4.01S as if we were working in XHTML, is there anything else to take into account? I mean, making our 4.01Strict documents as much closer to XHTML as possible in case in the future we have to switch over again.

d) Does 4.01 lack anything in terms of CSS functionality compared to XHTML? I hope not, that would be a big blow.

e) In terms of SEO are there any drawbacks whatsoever from using 4.01 Strict compared to XHTML? I mean, on my recent work, I m preparing a website which I build on XHTML strict, which fully validates (or so I thought!) and use CSS for design. Everything on the website replies on DIVs for layout (no tables). Will that be any issue if I was to switch the doc type to 4.01 strict?

f) What's with the charset? I see many of people tend to use iso-8859-1. Is there anything wrong of using UTF-8 in 4.01S or just a matter of preference?

g) My previous XHTML skeleton was:

<!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" xml:lang="en" lang="en">

<head profile="http://www.w3.org/2005/11/profile">
<title></title>
</head>
<body>
</body>
</html>

And the one I intend to replace it with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

<head>
<title></title>
</head>
<body>
</body>
</html>

The XHTML uses "http://www.w3.org/2005/11/profile" in the head tag. Is there any equivalent for the 4.01 Strict? I am really embarrassed I was about to use it and I don't even know what it does. I got the idea from W3Cs home, then run it through the validation service and voila! - "This document is XHTML Strict". That's one lesson learned: never rely solely on the validation service!

A penny for your thoughts on my comments!

Regards.

[edited by: encyclo at 5:40 pm (utc) on April 19, 2006]

2by4

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 12026 posted 6:50 pm on Apr 19, 2006 (gmt 0)

If you are going to serve it all as text anyway, what is the point of calling it xhtml?

You can actually skip everything else written in this thread and just focus on this one thing.

Re: HTML 4.01. Its life expectency? Same as HTML 2, 3.2. Your browser handles HTML 2 and 3.2 fine, and it will handle 4.01 as long as the web continues to be based around the hyper text transfer protocol. That's my guess anyway. New browsers aren't going to stop supporting it.

But be warned, certain tags are not being supported consistently any longer, on handheld browsers for example, frame/iframe tags are frequently not supported. So those are issues worth looking into.

HTML and CSS, no differences that I know of, there may be miniscule rendering differences browser to browser depending on doctypes, and types of doctypes, one line, two line, but those have to be tested for always no matter what, so essentially no difference.

CSS and XHTML were always the biggest source of confusion among newbie hmtl coders, I think somewhere along the line they thought that using XHTML somehow means using CSS, and using HTML means using font tags and so on.

Again, to change a website/templating system from xhtml to html, 2 search and replaces are required, firsrt for the xhtml doctype stuff, second a global search and replace ' />' -> '>'. And that's it.

But really, I wouldn't switch an xhtml site to html just because now that's the hip 'new' thing to do, as was the case before, what doc type you choose has very little meaning or significance as long as it matches your html coding standards for validation purposes.

Valid code is something altogether different, that's worth it, you can debug errors etc when you have valid code, but it doesn't matter what doctype you use.

iaaa

5+ Year Member



 
Msg#: 12026 posted 8:16 pm on Apr 19, 2006 (gmt 0)

Hi,

Perhaps I should have mentioned; I got all the content I need for my website already done - I haven't actually created the pages, so it won't be any hassle of choosing between

a)

<!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" xml:lang="en" lang="en">

<head profile="http://www.w3.org/2005/11/profile">
<title></title>
</head>
<body>
</body>
</html>

or

b)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

<head>
<title></title>
</head>
<body>
</body>
</html>

I am not quite sure I understand what you mean by:
"what doc type you choose has very little meaning or significance as long as it matches your html coding standards for validation purposes."
The page validates with no errors - it is the idea of the tag soup mentioned earlier that I don't like. Does the 'tag soup' effect refers towards the browser side or the robots as well? I mean would it be any difference or a difficulty when a robot encounters (a) or (b)? I know it is impossible for anyone to predict what the final chapter of all this would be. Do we have any clue as to when HTML 5 is due? If you were like me, starting a website now, which one would you go for (a) or (b)? Sorry if I sounded too judgemental - I am just not clear about things.

Regards

[edited by: encyclo at 8:24 pm (utc) on April 19, 2006]
[edit reason] formatting [/edit]

2by4

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 12026 posted 8:43 pm on Apr 19, 2006 (gmt 0)

if your code is xhtml, and your doctype is xhtml, they match. If your code is html 4.01 strict and your code is html 4.01 strict, they match.

that's all, it's not important which one you use, but if you want it to be technically 'correct', you need to use either xhtml 1.0 transitional for xhtml type code, served as text/html, or one of the htmls, 4.01 strict or loose.

The choice of which html/xhtml to use would be one of the less important things I could think of in life, and on a site, far far far below basic useability ideas, good navigation, clean layout, effective presentation of material, good content, good cross browser display support, etc.

Personally, I'd say if you aren't going to be serving xhtml as application xml+xhtml I think it's kind of silly, pointless really. But it really does not matter, you can happily leave all your code xhtml and it won't make any difference.

To me, the important thing to get is that it doesn't matter, and it never mattered, if you called your page html or xhtml, browsers just treat it all the same way, their error engines handle it fine, any browser out there, from lynx to the latest Safari will show your page fine, whether or not you use ' />' to close certain tags etc.

Same with spiders, as long as there aren't actually huge technical errors in the code, they don't care, if they did, 99% of the internet wouldn't get spidered.

The reality of the web is and has been that html is a very loose and forgiving language, browsers are designed to handle that with no issues, so are search engine spiders.

The real test is in debugging a real site layout in real browsers on real operating systems, that's where you should spend your time. Using matching code and doctypes helps the debugging process, since it's easier to debug when you know your code is error free, it removes one of the possible causes of rendering bugs.

It's only when you actually serve a page with application xml+xhtml that this stuff matters, then it's fun.

Just pick one you like and use it, and be aware of what it actually means when you do that. I make some stuff xhtml out of habit, but it just makes no difference at all in any larger sense.

Taffa

5+ Year Member



 
Msg#: 12026 posted 9:35 pm on Apr 19, 2006 (gmt 0)

c) Apart from keeping everything in lower case and generally coding in 4.01S as if we were working in XHTML, is there anything else to take into account? I mean, making our 4.01Strict documents as much closer to XHTML as possible in case in the future we have to switch over again.
In html 4.01 Strict some end tags for example (</tr>, </td>, </li>) are still optional. Correct me if I'm wrong but the W3C validator doesn't give warnings about optional end tags. Some third party validators have option to require optional end tags. I have understood that missing optional end tags may cause issues. Just make sure that you always have optional end tags in place.

Also if you need to use JavaScript use only scripts that access and manipulate content through DOM-methods.
In xhtml-world this is must but it's definitely good practise in html world too.

f) What's with the charset? I see many of people tend to use iso-8859-1. Is there anything wrong of using UTF-8 in 4.01S or just a matter of preference?

UTF-8 is recommended regardless of document type / format. See [webmasterworld.com...]

iaaa

5+ Year Member



 
Msg#: 12026 posted 9:41 pm on Apr 19, 2006 (gmt 0)
I can see your point now.

My code is in XHTML which matches the doc type I specified for my template. I have learned to code in XHTML (although there isn't a great difference in syntax). So what I understood is that I should leave the doc type as it is. As for the strict vs trasitional option, Encyclo mentioned this earlier:

"Both XHTML 1.0 Strict and Transitional may be served as text/html - it is only XHTML 1.1 which cannot according to the specifications."

So it won't make any difference whether I chose strict or transitional?

iaaa

5+ Year Member



 
Msg#: 12026 posted 10:02 pm on Apr 19, 2006 (gmt 0)
Thanks Taffa,

I will always ensure I use the optional end tags. I d always pay attention to little things like these, as they could make the difference in the future. Thanks for the reference to the library thread - great!

Regards

lsw_wd

5+ Year Member



 
Msg#: 12026 posted 5:18 pm on Apr 28, 2006 (gmt 0)

I have noticed a few comments here about the Meta tag stating the content type.

lsw_wd

5+ Year Member



 
Msg#: 12026 posted 5:47 pm on Apr 28, 2006 (gmt 0)

I have noticed a few comments here about the Meta tag stating the chartype.
f) What's with the charset? I see many of people tend to use iso-8859-1. Is there anything wrong of using UTF-8 in 4.01S or just a matter of preference?
being the most recent.

This is meaningless as the charset is set originally in the header, this is already set long before the browser gets to this Meta Tag.

The reason for that Meta tag is to make the Validator happy and to give a charset should the web site be looked at say on a desktop or somehwere else where no server is involved.

You can leave it on or off the site. It will only be used if you save a site to your HD or some form of memory.

----------

HTML 5 - Note when this is mentioned it is preceeded by a "What some people call HTML 5". To my knowledge this is not a real standard now or in the future. Officially HTML 4.01 is the current standard and most believe it to be the final version of HTML.

HTML 5 would be of no interest for soe time to come. This is in fact the only forum I am on where I have seen it mentioned yet. It will be unlikely to appear as a standard any time in the near future.

----------

I am seeing people right above asking about XHTML or HTML, that is well covered here. What bugs me is that so much software and even schools teaching web design are still teaching the use of HTML Transitional! The very name transitional clearly states it is temporary to help you adjust to the newest language... I think HTML 4.01 has been around long enough to justify teaching new designers to use Strict. I mean why teach them to code lazily and poorly? Teach them to do it right the first time.

Transitional simply allows you to bend or break rules when we should be trying to code te best we can.

XHTML 1.0 still has Transitional, Strict and Frame. Aside from the requiremet to serve application/xhtml+xml, XHTML 1.1 and later XHTML 2.0 only have strict (so the strict just falls out of the DOCTYPE as only being one choice it need not be stated).

XHTML and HTML both work quite fine with CSS, that has nothing to do with your choice. HTML can also be written identically to XHTML without naturally the closing backslashes in empty elements... so you should from habit write HTML as cleanly as XHTML is small cases with closed tags etc so you do it automatically.

As for the base of this thread, I was taught in Germany that XHTML was replacing HTML and was HTML - we now know this is incorrect. As stated, yo can do what you want. I argue pride in your work. If you want to use XHTML then serve it correctly. If not, then use HTML which is still a standard. If you use no XML languages like SVG or MathML, you do not need XHTML.

One last note for newbies:
XHTML served as XML, if you make a mistake in the code the user will not get your site, just a white page with for them odd text about and error. Mistakes are not tolerated in XML, it will completely stop loading the page at the first mistake. The code must be perfect! Everytime! So pages you add or change must be tested immediatly every time.

This can be problematic - Example:
Out of pride I serve my web sites as XHTML using application/xhtml+xml and using Content Negotiation to serve it as HTML to IE.

My site includes a RSS Feed. I may have 7 articles showing in the feed and add a new one with a simple mistake like a unesaped "&" for example. Tis breaks the site, that page is just a simple white page with a error message and my whole RSS Feed is broken, none of the articles are available because the RSS Feed is XML. So all my feed is down ubtil I find that one single unescaped "&" symbol.

My customers? I use CMS where I can for them and they add their own content. Most know nothing of web design. I do not dare to use XHTML served as XML on these sites because a simple mistake like a unescaped "&" can make the page unuseable... when it is the index page the whole site is unreachable.

Same goes with forums and commets on sites. Many CMS allow comments from readers. A readers comment may very well break your page or entire site so you have to check regularly that all pages are working.

So the likelyhood that a customer or commenter can break your site when served as XML is high. That is for me the best reason to stick with HTML - fr lack of a better term... it is more idiot proof.

Oh yea.... and Nice to meet you all!

Robin_reala

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 12026 posted 6:36 pm on Apr 28, 2006 (gmt 0)

My customers? I use CMS where I can for them and they add their own content. Most know nothing of web design. I do not dare to use XHTML served as XML on these sites because a simple mistake like a unescaped "&" can make the page unuseable... when it is the index page the whole site is unreachable.

In this situation, your tool should only produce valid markup and abstract the XHTML layer away from the user. In fact, if you're at all serious about accessibility then your CMS tool should be following w3's ATAG guidelines, and specifically in this case point 2.2 [w3.org]:

Ensure that the tool automatically generates valid markup. "Priority 1"

In other words if your tool isn't producing valid markup it is inaccessible.

lsw_wd

5+ Year Member



 
Msg#: 12026 posted 7:39 pm on Apr 28, 2006 (gmt 0)

That depends on what tool is chosen. XStandard, TinyMCE, PHP Markdown or no conversion at all. Also at anytime they can get into a code view of the content they are writing or editing.

Aside from that there are only a handfull of CMS that are accessible at all.

iaaa

5+ Year Member



 
Msg#: 12026 posted 7:47 pm on Apr 28, 2006 (gmt 0)

Nice post lsw_wd (and I thought this thread is dead)

Personally, I ve made my choice - its gonna be 4.01Strict for now. I originally designed my template using XHTML strict but never mind. Since I do not use any of its extra features, plus I would serve it as text/html (which is not correct). In regard with the charset I had to ask my webhost to change the html header's default which was set to the standard. I use UTF-8. What I am concerned about not using XHTML is that many major (including commercial) websites still use it, and still serve it as text instead of XML. But yet again, companies pay a few $$$$ and have their site redesigned using whatever technology they want. When the time comes to switch, it may be a nightmare for me to move to X-whatever-ML. I hope I can enjoy say maybe 5 more years with 4.01.

And all of these, because MS cannot be bothered and follow some standards. Why IE cannot be made to read XHTML served as xml? Its like they are doing it purposely to create confusion. Even for CSS, as I go along and enhance my website, *everything* renders the same for FF, Opera and NN - its only IE that has issues all the time. I hope some kind of miracle happens and people start to use standard-compliant browsers such as FF and Opera for that we won't have to say all the time 'how this is gonna display in IE', 'help - my design breaks in IE' and resort to 10s different hacks, just for IE. This approach has ended up turning web development into a rocket science!

Regards.

Robin_reala

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 12026 posted 9:25 pm on Apr 28, 2006 (gmt 0)

lsw_wd: none of that invalidates my point :) If you're going with application/xhtml+xml you'd better be serious about the CMS you choose.

lsw_wd

5+ Year Member



 
Msg#: 12026 posted 9:38 pm on Apr 28, 2006 (gmt 0)

Oh I am serious, that is why my customers get HTML and not XHTML.

As for the CMS, it is one of the few that is accssible, developed for the Guild of Accessible Web Designers. However with the majority of people on the net using garbage like Mambo and Co., this is a subject that needs to be brought up. 90% of all CMS have no interest in accessibility. Those that do are for the most part to expensive for most people.

So as long as peple use other CMS that do not really produce standard accessible code, this is a valid point. Using XHTML served correctly can be problematic unless care and time are taken to keep tabs on it.

This 75 message thread spans 3 pages: < < 75 ( 1 2 [3]
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved