Forum Moderators: open
You also need to consider whether to go for a Strict or Transitional version. If you can, I would recommend HTML 4.01 Strict (or XHTML 1.0 Strict if you must) - this will keep your code cleaner, more stuctural. You should use CSS for adding style, and make sure you validate all your code.
I prefer to code in XHTML. It makes me code cleaner and once I learned basic XML I understood the reasoning behind XHTML. Its a step in the right direction.
The WYSIWYG editor crowd - FrontPage and DreamWeaver - cannot generally be bothered with learning to code even HTML properly so why would they want to tackle XHTML?
Therein lay the gulf.
I agree partially. I have no desire to validate beyond it, but I am gradually replacing <table ... align="center"> by a <div align="center">. Slowly, as it is a very low priority.
I think the major step is to move from "street HTML" to valid HTML of any flavor. Which flavor is much less important.
I prefer to use HTML4.01 strict or transitional, because it doesn't use as much bandwidth as XML-based markup.
Doctype as displayed in the W3C homepage:
<?xml version="1.0" encoding="utf-8"?>
<!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" lang="en-US"
xml:lang="en-US">
And bandwidth as an issue? Let's see.. if I recall, in migrating from HTML to XHTML, I trimmed my page code by approximately 40% on average. I guess those extra closing tags I needed didn't cause too much damage.
Forward is forward. Code as you please, it's a big world. I've made my choice.
Use of XHTML & XML - use of these emerging language specifications (in conjunction with the appropriate use of style sheets) will make automatic conversions of content for alternative display even easier. XHTML and XML are ideally suited to machine manipulation of information.
Doctype from the above W3.org Auxiliary Benefits of Accessible Web Design page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
And from the New York Public Library Style Guide:
XHTML Guidelines & Benefits: XHTML is the standard markup language for web documents and the successor to HTML 4. Library projects must be authored in structural XHTML 1.0 Transitional.
http://www.nypl.org/styleguide/ [nypl.org]
Web technology will always be a journey rather than a destination, and engineers needs to get with the program, embrace, support and implement new standards as much as practicable, especially when they empower the end user.
Fundimentally though it depends on whether you buy into the "Semantic Web".
asp
if I recall, in migrating from HTML to XHTML, I trimmed my page code by approximately 40% on average
Thanks for sharing your info pb, but unless you were going from well marked up html 4.01 trans using css to xhtml then, unless I'm missing something, this isn't really relevant.
I'm still waiting for a reason to move to xhtml, other than "because the w3c sez so..." The most compelling site to cite against your doctype cites, is err... well, Google? If it conferred an advantage, they'd be doing it :)
Guys this is quite literally about semantics (pun intended), what is semantically useful for a human is with xml semantically useful for a machine.
This good both for search engine placements and if you happen to be blind.
asp
Gives: This Page Is Valid XHTML 1.0 Strict!
So according to the relevant TRs, what exactly is wrong with that doctype?
Hrm, when I go home tonight, I'm gonna have to check and see what mimetype gets served to which browsers, in Mozilla its application/xhtml+xml, I wonder what IE or WebmasterWorldill recieve... [edit]err, that should be 'w' '3' 'm' ' ' 'w' 'i' 'l' 'l', not WebmasterWorldill[/edit]
They also have a http-equiv meta that says text/html...
But they do something incredibly clever!
<style type="text/css">
<!--
...
-->
</style>
As for bandwidth, I've got two made-up validating pages (HTML Strict and XHTML) with:
three headings,
a table with a header, footer, and body, one row of three columns in the header and footer, and four rows of three columns in the body,
two paragraphs
All elements are used semantically. Using HTML gives me a 297 byte savings. (The HTML version doesn't have: </head> </body> </html> </head> </tfoot> </tbody> </tr> </td> </p>)
Remember that the only real difference between XHTML and HTML is that XHTML is XML-based, and HTML is SGML based.
I'm still waiting for a reason to move to xhtml, other than "because the w3c sez so..." The most compelling site to cite against your doctype cites, is err... well, Google? If it conferred an advantage, they'd be doing it
Gee, I wonder where the valid HTML 4.0 that you choose to stick with came from? No matter, I know there were similar arguments against migrating from HTML3.2.
Google.. not yet, but FAST?
AlltheWeb... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
AlltheWeb.com made the transition several months ago.
As for bandwidth, I've got two made-up validating pages (HTML Strict and XHTML) with:
three headings,
a table with a header, footer, and body, one row of three columns in the header and footer, and four rows of three columns in the body,
two paragraphs
Ummm... you use tables? For tabular data only right? ;)
I was concerned about bandwidth... I abandoned table layouts over two years ago. Pure CSS... now we're talkin' bandwidth savings!
I'm still waiting to here about the "significant issues" against XHTML. But then again, not really. I already know how my code renders on Internet enabled cell phones, pdas and other emerging technologies, and after all, that is the primary motive behind the thrust to XHTML.
Nuff said. Have a good weekend.
This good both for search engine placements and if you happen to be blind.
Glad to hear about your search engine positions asp, but I have to take issue with this statement.
You don't need to use xhtml to achieve good SE results. And the semantic stuff doesn't really achieve anything unless everyone marks up their code consistently e.g. there is no w3c standard for how to markup breadcrumbs, global nav, local nav etc - presumably because these aren't semantic enough ;)
And xhtml or xml gives ABSOLUTELY NO advantage to visually impaired users. None whatsoever. Most visually impaired people use IE with Jaws. Semantics doesn't come into it. It's really important that folks understand this cos otherwise people might start thinking that marking up in xhtml alone makes their content accessible. Accessibility is not a syntax issue.
I don't buy into the semantic web idea(l), as you've probably guessed :)
And xhtml or xml gives ABSOLUTELY NO advantage to visually impaired users. None whatsoever. Most visually impaired people use IE with Jaws. Semantics doesn't come into it. It's really important that folks understand this cos otherwise people might start thinking that marking up in xhtml alone makes their content accessible. Accessibility is not a syntax issue.
asp, at this point mouth a gasp, picks himself up off the floor, steadies his typing finger, and replies...
Mattur,
I am.... I am.... absolutely gobsmacked anyone can make that statement.... I know you're no newbie, but I think you're talking utter sh1t ;)
The orginal "what's best html vs xhtml" was a lame and useless question, but the question "Does XML convey semantic information better than HTML" is a question worthy of this forum, so I hope you'll forgive me but I've started a new thread to discuss this: [webmasterworld.com...]
So I hope you'll join me there ;)
asp
I stand by my two points: xhtml gives you no SE ranking advantage and does not in *any* way improve accessibility.
It would be interesting to hear your explanation of why xhtml is more accessible than html...? :)
This, however, does not require a move to XHTML at the same time, though many people do do this.
Personally I'm still happy with HTML 4.01 as it does everything that I require.
universalis - what are the significant issues you have found with XHTML?
There are several issues, none critical, but important if you are making a serious attempt to adhere to the standards. The biggest hurdle, ignored by the vast majority of people currently using XHTML, is the MIME type conundrum. XHTML 1.0, according to the specification, should be served with the MIME type
application/xml+xhtml rather than text/html. XHTML 1.1, again according to the W3C specification, MUST be served as application/xml+xhtml. Of course, Internet Explorer choke on anything with this MIME type, leaving the only reasonable option, which is to use a server-side scripting language or mod_rewrite solution to serve an appropriate MIME type to different browsers. If you don't bother with this issue, all browsers will treat your markup as HTML rather than XHTML. This is a problem, as valid XHTML is actually invalid HTML. Secondly, a lot of XHTML authors reckon that if you add a few trailing slashes and an xmlns namespace to an existing document, you have an XHTML document. Ther trouble is, the vast majority of these documents contain errors, which will break the page if the correct MIME type is used. Such documents are definitively not forward-compatible, as once
application/xml+xhtml is more widespread, vast swathes of current web sites using XHTML incorrectly risk to break. Other issues include inline CSS and Javascript - if you use comment tags to hide such styles or scripts, they won't work in
application/xml+xhtml documents, and putting such scripts in CDATA blocks can cause problems with backward compatibility. Also, both CSS and JS behave differently depending on the MIME type - again, breaking your page. XHTML is XML, not HTML, and so you need to work in a different way. There are no advantages to using XHTML at the moment, unless you are combining it with MathML, SVG or other XML data. Better to write semantic, well-formed, validated HTML 4.01 Strict with CSS for commercial projects, and keep the XHTML for more experimental use.
CSS support is much better than now, and all common browsers are fully compliant with it.
Excuse me. Wanna run that by me again? Don't make statements like that please... some might actually believe it.
Even Opera 7.11, arguably the most CSS enabled browser, is not "fully" compliant.
Secondly, a lot of XHTML authors reckon that if you add a few trailing slashes and an xmlns namespace to an existing document, you have an XHTML document.
I never ascribed to the theory that "if I stay in my house, I'll never have to worry about falling trees." Too limiting. Time to move on...
Arguments that are based on presuppositions and blanket assumptions hold little validity.
Fair comment. I am guilty of making a blanket assumption in my last post, so perhaps I'd better clarify. XHTML can be used well, and is being used well in many places. However, you continue to get such travesties as espn dot com (who appear now to have given up horrendeous, invalid XHTML for horrendeous, invalid HTML 4.01 Transitional). Other web publishing tools like Movable Type base their default templates on XHTML Transitional, which often get quickly mangled by their users, putting the forward-compatibility of these sites at risk. Put invalid XHTML through an XML parser (as you do when specifying
application/xml+xhtml), and you'll get a DOM tree and error message. You won't get this problem with HTML. I don't think XHTML should be outlawed or even left unused, it is just that, despite it's qualities, I don't think it's ready yet for serious production use in a commercial context. In smaller-scale projects, techical documents (especially when combining XHTML with other XML content), or for advanced users, XHTML remains an excellent choice.