Opening a SVG in a browser renders XML code instead of image
As for your last question: How do browsers determine whether to show an image or XML code?
The answer lies in XML namespace. The XML namespace specified in an XML tag tells the user agent how to handle the tags. So if you have an <svg>
without attribute xmlns="http://www.w3.org/2000/svg"
then the browser will show text not the SVG rendered vector graphics.