Is there any reason to consider XHTML related details for web development for someone who works with HTML4 and plans to work with HTML5?

Or was XHTML a "side" development in web technology which is not related to the current mainstream of web development (which I guess is HTML5)?

Rationale for asking

The reason I'm asking is that a StackOverflow answer I previously posted was recently commented on to the effect that "You should NOT use upper case HTML tags". When I asked "why" the commenter pointed me to a couple of articles, both of which gave the reasoning for lowercase-only tag names as "Upper case tag names are not allowed in XHTML" as the main reason.

Since I don't currently do web development in XHTML (pure HTML4.0) and only plan to use HTML5 as the next step, I'm interested in whether XHTML should be a factor in assorted decisions I make as far as web development

Please note that this question is NOT asking whether one should use upper or lower case tag names in pure HTML - merely whether the upper-case-tag prohibition in XHTML should be a factor in my decision making, or I should ignore XHTML related rules.

4 Answers
4

Most of the info you will find on XHTML fails to mention that the whole purpose of XHTML is to be used by both humans and computers for data exchange. XHTML was created so that computers could talk to each other, but in the same time remain readable by humans.
The most crazy thing is that various code monks became obsessed with XHTML compliance, without any intend of using the XHTML for data exchange and without understanding what XHTML actually is.

Edit:
A good example of XHTML use is an airline company publishing its flights. The company can utilize XHTML to produce a single list of flights that will be both consumable be humans visiting online and by services that will read the data for their needs.

On the other hand if you own a hair-salon, there is no need for your site to validate against XHTML standards.

Very interesting. Though, for most purposes, I don't think data consumption by computers is something we need to ensure as web developers. I guess it would be helpful if the situation comes to it.
–
PuragMay 13 '12 at 18:15

Don't we need to make our data available to feed readers or the googlebot? What about screenreaders? Ajax anybody?
–
Sinthia VSep 5 '12 at 21:36

Directly, there's no reason to take into account XHTML rules when marking up documents for the HTML serialization of HTML5.¹ However, it seems to be the modern practice to use lower case for tags, and that has been partly influenced by XML and XHTML. So if you find yourself working in a large team of developers, it is quite likely that the coding guidelines for the team will mandate lower case just for consistency's sake. So, it might be worth getting into the habit of doing so.

¹ Note that there's also the possibility of using the XHTML serialization of HTML5, in which case it would matter of course, but I don't think that's what you are asking about.

As far as I can tell, XHTML was intended to be a kind of combination between the features of HTML and the strictness of XML. For example, in HTML you can write <b><i>test</b></i> and the browser won't care, it knows what you meant. Whereas in XHTML that would cause an error and block the entire page from showing.

However most browsers just tolerated errors in XHTML as well, so it became kind of pointless.

Personally, the only reason I can give for choosing to use lowercase tag names rather than uppercase is because I'm too lazy to hold the Shift key and I remapped my CapsLock key to something more useful.

thats not even valid HTML, and no, the browser will care -- it will do its best to assume what you meant, which may or may not be what you actually meant. for example <p>test<div>test</div>test</p> will not produce the dom that you probably expect it to. Nor will <p><i>test<p><i>test<p><i>test.
–
32bitkidMay 13 '12 at 3:17

From what I've personally observed about XHTML, the only "benefit" of it is the versatility—for example, it is my understanding that with relative ease, one can create a custom tag/element or attribute and still validate with XHTML.

I see no need for custom tags, since if there isn't one that doesn't fit semantically (though the cases are minimal due to HTML5's improvements in semantic markup), you can just use a div or span and use a class or id to make it "fit." And HTML5 does allow custom attributes anyways.

So I see no direct relationship—or at least, I don't think there should be one—between HTML5 and XHTML (and anyways, XHTML 1.0 is meant to be a combination of HTML 4 and XML). The spec doesn't recommend one over the other, it just notes the fact that in HTML5, they are case-insensitive.

I personally use lowercase tag names for two reasons:

It's a nuisance to hold shift every time (though one could argue that you hold shift to get the angular brackets, but whatever).

It's a style preference—I truly think it looks much cleaner with lowercase tag names as well as a lowercase doctype (<!doctype html>). Uppercase tag names are really old-fashioned, and you don't really see them anymore. It may just be a thing with newer generation programmers such as myself.

And either way, you should pay no mind to rules that apply to a doctype you're not even working with.