|
| |
|
|
anderskorte
Posts: 545 Joined: 2/20/2005 From: Finland Status: offline
|
To XHTML or not to XHTML - 5/4/2005 13:23:19
I'm still bouncing between these two options. Whether to continue using HTML or move on to XHTML? Well, I admit I've been using XHTML 1.0 Strict for years alright, but have begun to question whether it's really necessary. Like, why bother with all those lang and xml:lang attributes, xml namespaces, all tags getting ended and ridiculously complex ways to define CDATA for style and script elements if you don't even serve or use it as real XML? There just doesn't seem to be any good arguments for using XHTML over HTML. Not yet. As long as IE doesn't support application/xhtml+xml it seems to be just the same which one you use. XHTML 1.0 has been a W3C Recommendation since 2000. But once again we have to notice that the recommendation says that XHTML *should* be served as application/xhtml+xml, but *may* also be served as text/html. How can anyone with at least two brain cells working recommend using application/xhtml+xml if the most popular web browser doesn't support it at all? This exactly is the dilemma. W3C Recommendations are, in practice, recommendations for future technologies. Should I go with the recommended when the older choice is just as good -- or in practice even better? The HTML compliance in XHTML is a bit of a hack -- a dirty hack, since the current XHTML syntax is not even valid HTML. It's nothing but XHTML that's forced to be compliant with HTML "tagsoup" user agents. Should we wait until XHTML is ready for the primetime? If XHTML is being served as text/html it's identical to using HTML, because both are SGML-based. Only when you serve it as text/xml, application/xml or application/xhtml+xml it becomes an XML-powered markup language -- the way it was intended in the first place. Writing HTML is just as good and standards-compliant as using XHTML to mark up your websites. So, what's the point? To or not to?
|
|
|
|
BobbyDouglas
Posts: 5479 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: To XHTML or not to XHTML - 5/4/2005 13:39:16
Before I respond, what are you waiting to see in XHTML? If it isn't in its primetime... what is it missing? Has anyone noticed a big change between HTML 4.01 transitional to xhtml 1.1?
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
anderskorte
Posts: 545 Joined: 2/20/2005 From: Finland Status: offline
|
RE: To XHTML or not to XHTML - 5/4/2005 13:54:51
Yeah well XHTML is ready for the primetime but the browsers aren't. That's what I meant. IE's support of XHTML is the red line here.
|
|
|
|
BobbyDouglas
Posts: 5479 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: To XHTML or not to XHTML - 5/4/2005 14:27:19
Well I can understand that some people might not like it right out of the box, but the nice thing is that you can have your custom dtds that call in certain mods. Such as having iframes, target="_blank" as well as others. I thought IE/FF/Opera/ all other common ones, supported XHTML very well. I'm not expert on it, but I assumed that it worked fine. I wouldn't suggest updating all your websites to be compliant with XHTML if you are using HTML 4.01 right now. I thought the difference between the two were very minimal, and that it wasn't worth the time/reward to do it. What else is expected from XHTML? Is there something that is going to be improved over the enxt year or so? I only use it when I develop sites that don't use tables (mainly divs and css), which is very sledom.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
anderskorte
Posts: 545 Joined: 2/20/2005 From: Finland Status: offline
|
RE: To XHTML or not to XHTML - 5/5/2005 3:18:50
quote:
but the nice thing is that you can have your custom dtds that call in certain mods. You're talking about XHTML Modularization, aren't you? Haven't studied it at all yet. quote:
I thought IE/FF/Opera/ all other common ones, supported XHTML very well. I'm not expert on it, but I assumed that it worked fine. IE prefectly supports XHTML that is served as text/html. When you send it as application/xhtml+xml it doesn't understand it, but offers a file download. text/xml and application/xml cause IE to display the source. quote:
I wouldn't suggest updating all your websites to be compliant with XHTML if you are using HTML 4.01 right now. I thought the difference between the two were very minimal, and that it wasn't worth the time/reward to do it. Exactly. It's not necessary yet, which gets me to the next quote... quote:
What else is expected from XHTML? Is there something that is going to be improved over the enxt year or so? There is 1.0, 1.1 and 2.0 -- 1.0 being the HTML compliant one, 1.1 the first *real* XHTML that should not be served as text/html and 2.0 the next generation future markup language. XHTML gets it's real power when served as XML. So, this is exactly what we're waiting for: all modern browsers becoming compliant with the application/xhtml+xml mimetype, or at least accepting text/xml and application/xml. This can't be done anywhere during the next few years since this would mean dropping off support for older browsers. Because of this, the "real" XHTML isn't ready to be used yet. quote:
The only thing I've noticed since I switched to XHTML strict is that once I got used to the more stringent guidelines my pages worked better, looked better, and performed better across the browser platform. Well, that's basically the same as HTML 4.01 Strict. I've never noticed any parsing differences between these two. By the way, did you all know that you can serve application/xml for IE and still make it work? It's sort of a hack, but according to my experiences it works perfectly. The only problem is that it requires use of XML prologs, so IE is forever in quirks mode. http://www.w3.org/MarkUp/2004/xhtml-faq#ie It even works in IE5, but for some reason IE5 seems to strip off all the default CSS styles (paragraph margins, font sizes, list markers etc.). Try out this little hack. It's very exciting to experiment how a real XML mimetype affects the parsing of CSS, page loading and all.
|
|
|
|
anderskorte
Posts: 545 Joined: 2/20/2005 From: Finland Status: offline
|
RE: To XHTML or not to XHTML - 5/5/2005 3:51:00
Oh, and just one very important thing I forgot to mention. Validation. The whole point of developing XHTML in the first place was to drop off the error handling of the SGML-based HTML and, in conjunction, build a web of documents that are valid, because they have to. If you write XHTML that is invalid (people make mistakes) and serve it as text/html you don't run into any problems, because it isn't real XHTML yet. XHTML 1.0 served as text/html is just a middle stage towards the use of real XHTML documents. Hence, future versions (XHTML 1.1 and 2.0) should not be served as HTML anymore. Right now I see the only reason for using XHTML is that -- somewhere in the future -- the websites you develop can be easily migrated to an application/xhtml+xml mimetype (if they need to). XHTML served as XML doesn't tolerate errors. If you have but one error in your code, the page breaks horribly and doesn't get displayed at all. But if you serve XHTML as text/html, it still accepts errors. So it's nothing more than regular HTML after all.
|
|
|
|
anderskorte
Posts: 545 Joined: 2/20/2005 From: Finland Status: offline
|
RE: To XHTML or not to XHTML - 5/6/2005 2:22:50
quote:
After reading this thread I changed a couple of pages to read "xhtml + xml" and they still validate and work perfectly in all browsers. From what has been said above I expected the page to break in IE. Donkey, are you sure you sent it as "application/xhtml+xml"? That mimetype does break IE. Same thing if you send it as "application/octet-stream" or "text/foobar". Changing the mimetype doesn't affect validation. Or did I understand you correctly? quote:
Got me. I write XHTML and have no problems in fact I get better results. Yes, of course because it's XHTML 1.0 served as text/html. It is meant to be compatible with non-XHTML-supporting browsers which have never even heard of something called XHTML. The backwards compatiblity in XHTML isn't perfect, but it does seem to work as such.
< Message edited by anderskorte -- 5/6/2005 2:36:27 >
|
|
|
|
womble
Posts: 5721 Joined: 3/14/2005 From: Living on the edge Status: offline
|
RE: To XHTML or not to XHTML - 5/6/2005 8:54:14
quote:
I don't understand the argument properly could you enlighten me here. I am developing a site in xhtml, both xhtml and CSS validate OK using "text/html". After reading this thread I changed a couple of pages to read "xhtml + xml" and they still validate and work perfectly in all browsers. From what has been said above I expected the page to break in IE. What am I missing? I too am a little confused, possiblity being due to being a relative newbie to xhtml, and the fact my brain's not yet back up to full power yet following my op. On the subject of 'to xhtml or not to xhtml' though, my understanding is that while switching to xhtml may not fully reap the full benefits of using xhtml with the somewhat patchy support for xhmtl/css in some browsers, switching to xhtml now future-proofs your sites. My current favourite read, another Amazon purchase (yes, I know I really do need to get out more) is "Web Standards Solutions: The Markup and Style Handbook" by Dan Cederholm, which IMHO is fantastic becuase it doesn't just say 'this is the way the standards say to do it', and leave it at that, but shows the benefits of using xhtml/css and the reasoning behind it, but also a selection of methods for doing the same thing in different ways, the different reasoning behind each of the methods and hacks for overcoming the peculiarities of IE5 etc. and older browsers.
|
|
|
|
anderskorte
Posts: 545 Joined: 2/20/2005 From: Finland Status: offline
|
RE: To XHTML or not to XHTML - 5/9/2005 1:25:36
quote:
ORIGINAL: Donkey I was using abyss web server on my machine which I use as a test server, I haven't tried it on a page published as a web address. Should that make a difference? Once again, I don't have much experience about web servers but no, shouldn't make any difference.
|
|
|
|
anderskorte
Posts: 545 Joined: 2/20/2005 From: Finland Status: offline
|
RE: To XHTML or not to XHTML - 5/21/2005 3:54:43
Now that this is posted in Hints and Tips anyway, I think I'll post a brief summary of all this. With a bit of research I've come to the conclusion that it's recommended to use XHTML. It is, after all, the most recent version of HTML and works great on all modern and not-so-modern browsers. It does require a bit more work, though. To define the document language you must define both lang and xml:lang everywhere. All the markup has to be in lowercase. All tags must be ended with either a closing tag or with a space and a slash (like <br />). A elements can't contain other A elements. The language attribute for SCRIPT is deprecated. Changing the mimetype changes CSS parsing etc. etc. You also have to escape the CDATA definitions on STYLE and SCRIPT elements. This is painfully complex, so it's better not to use "embedded" styles and scripts in documents at all. Use external ones instead (like CSS files defined with the LINK elements etc). But the most important thing about moving to XHTML is validation. Validate your pages and fix the errors whenever possible. If you use XHTML you're also promoting standards. HTML 4 is a standard, too, but XHTML is the modern way to write webpages. It will also most likely future-proof your pages, as womble said above.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|