As long as I remember, I make great efforts to do everything right. Good thing I consider the right way to be anyway.
Now I feel that the time has come to get answers to very important questions once and for all.
Everyone who swore on XHTML would sooner or later stumble upon a quote: โIf you don't serve the right MIME type, the document will be interpreted as plain HTMLโ
Tell what? I created a perfectly healthy XHTML document, following all standards, etc. What have I done wrong? What did I miss?
As far as I understand, this is a server thing for the most part, so of course I investigated it too, and it would seem that the header of the PHP () function is the answer to the problem.
Yes, then all is well. Well no, this is actually not the case, because no matter how much I search on the network, I just canโt find consistent information on how to solve the problem, and when I find something remotely relevant, it's all about browser compatibility and the like.
Let it be said as clearly as possible.
I donโt care about the computing power of the browser. (not at the moment)
All I really need is to get an epic XML error message if I make a mistake and, of course, of course, knowing how I do it.
In short, I want to part with the SGML method and embrace the XML method, and I want, even without the slightest doubt, to say that this document is valid XML / XHTML and is interpreted as such.
My thought is that I can simply require that the XHTML document in question, via a PHP script, send it with the appropriate MIME type, but how this is actually done is still a mystery due to conflicting information about net.
I hope someone can provide the answer I'm looking for, preferably with links to relevant information for backing it up. If you can do this for me, I will be forever grateful.
Sincerely.
Edit: I cannot say that I understand why and how, but at least I found a way to make it act as it should, just adding: on top of a regular xhtml document, of course, changing the file type to PHP so that actually run his script.
I am absolutely sure that this is not the end of the story, but so far I am happy.