XML declaration in HTML/XHTML

But, they don’t have compelling reason to use xhtml+xml, do they? If they did, are you saying there would be no qc? It’s for sure the traders, shoppers, and social butterflies have no need for that technology. Or, are you still on about html? It’s a done deal. Over. We’ve got bloated, error fixing browsers, and we’re stuck with the results.

If you’re going on about xhtml+xml, that’s effectively a different technology. MSFT have killed it anyway, even if they are playing Johnny-come-lately to the xhtml party.

cheers,

gary

Mistakes happen… that’s just real life. I agree with Christian. Mistakes happen, and it’s not worth using XHTML just because.

A very very very common occurrence is with a CMS. CMSes are generally set up so non-developers can maintain content on a website. However, being non-developers, they’re likely to make quite a few mistakes and not know better. Sure, you can strip out all HTML, but that’s not a real world scenario either. They often need some sort of formatting, which requires HTML at some point.

Mistakes happen, yes and it’s child is called Fred. Perversely that takes the attitude that slipshod markup should also be embraced because browsers tolerate bad markup practice, e.g. some start tags can end with /> being permitted for its HTML ‘text/html’ version.

I’d have to agree with Gary if you are the sole webmaster and in control of the markup totally. Then there is no real reason to violate well-formedness in x(ht)ml if you believe in craftsmanship.

M$FT are mainly deciding they now like the idea of application/xhtml+xml because ironically they like Fred, and it requires the use of that MIME in some circumstances.

We’re not talking about xhtml, “just because”. At least I’m not. XHTML+XML is a different technology from html, and they have different purposes. Now, I use the xhtml syntax just because; just because I ran an intranet that used xhtml+xml, I configured my tools for xhtml, felt that switching back and forth between syntaxes created opportunity for error, and am too lazy to reconfig my tools or break long time habits.

A very very very common occurrence is with a CMS. CMSes are generally set up so non-developers can maintain content on a website. However, being non-developers, they’re likely to make quite a few mistakes and not know better. Sure, you can strip out all HTML, but that’s not a real world scenario either. They often need some sort of formatting, which requires HTML at some point.
Whatever are you going on about? If they need xhtml+xml, html is not going to do the job. Do not confuse xhtml syntax in an html document with xhtml+xml. XHTML syntax MAY be used in an html document; the reverse is not true.

cheers,

gary

If you have a purpose for XHTML, then you will need to be careful.

However, 99% of people using XHTML now use it “just because”, not making use of any of the advantages it has over HTML. In these cases, XHTML is a very bad choice.

For example, Wordpress serves as XHTML by default. I love Wordpress, but this is a very bad move on their part (which is why I always force my templates into HTML). They make use of nothing special that XHTML can do, they just made it XHTML because that was what everyone else thought was “professional” to use.

How is that different from marking up any page in any semantic or structural markup language? Aren’t you careful to use correct syntax?

However, 99% of people using XHTML now use it “just because”, not making use of any of the advantages it has over HTML. In these cases, XHTML is a very bad choice.
How so? The best even Hixie (Ian Hickson) can do is talk about coder incompetence and obscure edge cases. (Sending XHTML as text/html Considered Harmful) What reasons do you have?

For example, Wordpress serves as XHTML by default. I love Wordpress, but this is a very bad move on their part (which is why I always force my templates into HTML). They make use of nothing special that XHTML can do, they just made it XHTML because that was what everyone else thought was “professional” to use.
Orthogonal to the question at hand.

cheers,

gary

Felgall, I thought when you checked your invalid XHTML page in IE9, it rendered the page (instead of showing an error). Or does it depend on a setting??

Wordpress: wordpress doesn’t send anything as XHTML, it just uses the hipper doctype. Two different things. XHTML doctype and /> everywhere != XHTML so I don’t see the issue. I agree with Gary: if you are using XHTML because you need it, then your setup is going to be ok with the draconian error handling. All the whinging from Mark Pilgrim was highly entertaining, but he was talking about situations that had no reason or need to be XHTML (there were no XML documents being stored, manipulated by software who also needed to be presented as web pages).

I’m saying that if you are going to have someone else (a non-coder) editting content (which is very very very common in the real world), then it needs to be resistant to minor markup mistakes.

As for Wordpress, I agree that it isn’t really XHTML, but it does use that DOCTYPE. I do a replace to get rid of the />s, so it becomes valid HTML.

And, I’m saying that which syntax you use, either html or xhtml, just doesn’t matter if you’re serving up text/html.

If you’re serving application/xhtml+xml, that unqualified, untrained and incompetent non-coder type person has no business touching the markup. He, she, or your pet monkey has no business editing your javascript, PHP, or database queries either.

gary

The point is though: why use XHTML if you’re gonna serve it as text/html? That defeats the purpose entirely…

As has already been pointed out you do it to follow the latest trend. At least what used to be the latest trend. The current latest trend is for HTML 5. So now we all have to unlearn the XHTML stuff and learn the HTML stuff. Does that mean I have to type my tags in uppercase now?

Seriously no one cares. Was just going through the theme guidelines for the website baker CMS. The guidelines were made in 2008 and they require that all themes be XHTML 1.0 transitional. Whatever works I say. The burden is on browser developers to render everything perfectly!

I have already told you why I use xhtml syntax, and since either xhtml or html syntax is compatible as text/html, I see no compelling reason to change. HTML5 specifically allows either syntax. Since it doesn’t make any difference, just what purpose is being defeated? So what if you don’t use all its features. Just because you don’t use all its capabilities doesn’t mean you chuck xhtml. You don’t dump your car because it will go faster than the speed limit, right?

This thread is officially giving me tired-head. I’m done.

gary

I’d have to mainly agree with Gary even Fred ‘text/html’ allows the closing slash on void elements. Hence no major difference between an author that writes that in Fred, or an author that writes ‘vanilla’ XHTML 1.0 Transitional ‘grammar’ being sent to the legacy HTML user agent. Both may contain slashes. The fun only starts when the XML parser is running, which is NOT a requirement of vanilla Transitional.

abdussamad: I think you represent the general coder, who just wants to get stuff done… this argument here though is the validator nitpicking we like to do now and then for the sake of… just because : )

To anyone: so, IE9 shows an error, or not? when presented with a true (sent as application xhtml+xml) XHTML page with an error?

I’d like to know for certain what IE9 does with an invalid XHTML page, since I’ve heard conflicting things.

I’m rather unhappy that I cannot test IE9 myself.

I tested it in Internet Explorer 9. It is able to handle the application/xml MIME type, but it incorrectly continues to render the page upon encountering an error. Chrome correctly stops rendering the page. Therefore, Internet Explorer 9 is not really XHTML compatible, but apparently accepts the MIME type, and then converts it to text/html.

XHTML Test Page

The XHTML 1.0 specs do not state the user agent has to spit out an error or break on an error.

I would have sent: ‘application/xhtml+xml’ like on my site. Though you have to fiddle with the settings I believe to get [IE9] to show errors http://blogs.msdn.com/b/ie/archive/2010/11/01/xhtml-in-ie9.aspx might be useful but obviously I cannot help as I don’t have IE9.

Once a fatal error (well-formedness violation will suffice) is detected, the processor MUST NOT continue normal processing (i.e., it MUST NOT continue to pass character data and information about the document’s logical structure to the application in the normal way). Halt on error in essence and stop rendering.

The XHTML 1.0 specs do not state the user agent has to spit out an error or break on an error.

I hope you’re not using Appendix C as some reason for that quote.

I personally prefer an animated gif of the nyan cat upon fatal error, but that’s me.

No I didn’t look at Appendix C, the spec (XHTML 1.0) does not dictate that an agent has to display or break on error.
Either way, IE 9 conforms to XHTML 5 not previous versions of XHTML.

logic_earth
Good point, I’ve corrected the text.

xhtmlcoder
I’ve updated it:
XHTML Test Page will use application/xhtml+xml
XHTML Test Page will use application/xml
XHTML Test Page will use text/html