1

recently a third party plugin I'm using to display online magazines stopped working on mobile devices. According to their help page, this happens for people serving with IIS. Their solution is to set the MIME type .xml to "application/xml". It's by default set to "text/xml". Changing it does work, but would that have unintended side effects or is it actually the correct way and IIS just set it wrong?

1 Answer 1

1

Both text/xml and application/xml are standardized in RFC 3023 for describing a XML document entity. In general, the main difference is that text/* MIME type family is used for human-readable text data (when no explicit support is provided, should be treated as text/plain), while application/* is for machine-readable data not readable by casual users. This has implications for encoding choice algorithm, even in XML.

From the theoretical point of view, if you add the charset parameter (e. g. text/xml;charset=utf-8), there is almost no difference. In practice nobody could guarantee sane implementation of standards. This is why text/xml does not work for you. If you switch to application/xml, you fix your problem and possibly break something else.

Personally I think that application/xml is the safer one as it implies human-unreadable contents. Even better, encode your document using UTF-8 and add the charset parameter (application/xml;charset=utf-8) as UTF-8 must be supported by all XML processors and charset parameter is both strongly recommended by RFC and used in practice to choose encoding.

See also related question on StackOverflow.

1
  • Thanks, makes sense now. I can't encode the document as it's basically a generated page from a 3rd party program that I just link to. But seems to me like application/xml is more 'generic' so hopefully it shouldn't cause problems.
    – Rodolfo
    Oct 29, 2013 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.