Note that there are some explanatory texts on larger screens.

plurals
  1. POServing your XHTML with the correct MIME type
    primarykey
    data
    text
    <p>As long as I can remember, I've make a great effort to do things the proper way. Well, what I consider the proper way to be anyway.</p> <p>Now I feel that it is time to get some very important questions answered once and for all.</p> <p>All who swear to XHTML will, sooner or later, stumble upon the quote: "unless you serve the right MIME type, you document will be interpreted as regular HTML"</p> <p>Say what? I've created a perfectly sound XHTML document, following all the standards and stuff. What have I done wrong? What have I missed?</p> <p>As far as I understand it, it's a server thing for the most part, so of course I've investigated that too, and it would seem that the PHP function header() is the answer to the problem.</p> <p>Yay, then all is good. Well no, in fact it's not, because no matter how much I search the net, I am simply unable to find consistent information about how to go about the problem and when I do find something remotely relevant, it's all about browser comparability and such.</p> <p>Let it be said as clearly as possible.</p> <p>I so not care about browser computability. (not at this point anyway)</p> <p>All I really want is receive the XML type epic fail message if I've made a mistake and of course of course the knowledge about how I actually make this happen.</p> <p>In short, I want to part with the SGML way and embrace the XML way, and I want to be able, without even the tiniest bit of doubt, to say that this document is valid XML/XHTML and is interpreted as such.</p> <p>My thought is that I can simply require the XHTML document in question, via a PHP script, and send it of with a proper MIME type, but how it is actually done is still a mystery due to conflicting information on the net.</p> <p>I do hope that someone will be able to supply the answer I'm looking for, preferably with links to the relevant information to back it up. If you can do this for me, I will be forever grateful.</p> <p>Best regards.</p> <p>Edit: I can't say that I understand why or how, but at least I found a way to make it act as it should, simply by adding: to the top of a regular xhtml document, of course changing the filetype to PHP to actually make it run the script.</p> <p>I'm quite sure that this is not the end of the story, but for now I'm happy.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload