[ACCEPTED]-Opening a SVG in a browser renders XML code instead of image-svg

Accepted answer
Score: 37

As for your last question: How do browsers 7 determine whether to show an image or XML 6 code?

The answer lies in XML namespace. The 5 XML namespace specified in an XML tag tells 4 the user agent how to handle the tags. So 3 if you have an <svg> without attribute xmlns="http://www.w3.org/2000/svg" then 2 the browser will show text not the SVG rendered 1 vector graphics.

Score: 2

You have to configure your server to send 2 you svg files with Content-Type: image/svg+xml header. Here is an example 1 on how to do this with Apache.

More Related questions