O'Reilly logo

Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Item 45. Pick the Correct MIME Media Type

XML processors, web browsers, and many other tools rely on MIME media types to dispatch XML content to the correct processor. Just a few minutes ago I got an e-mail from an annoyed reader because I'd published some SVG pictures with the MIME type text/xml instead of application/xml+svg, so his SVG viewer couldn't read them. It's not hard to set the correct MIME type in most web servers. However, most existing servers ship with incorrect or incomplete MIME types, so you probably have to fix your server's configuration before publishing.

Pure, undifferentiated XML comes in two flavors:

  1. text/xml; charset=“iso-8859-2”

  2. application/xml; charset=“utf-16be”

If no more specific MIME type has been registered for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required