Why do browsers display code when viewing XML?
Why do browsers display code when viewing XML?Answer: Web browsers only know how to display one type of XML: XHTML. All other XML that is opened in a Web browser will display as plain markup code unless you tell the browser how to display that markup. In other words, you could markup a complete XML document and never tell it how to display in a browser or in a printout. In fact, most XML has no styles attached to it, because they aren’t meant to be viewed in Web browsers. Instead they are used as data sources for Web applications like with Ajax. The simplest way to display XML in a nice fashion is to include SHTML tags in the markup. This tells Web browsers how to display the content. You can also use CSS style sheets to style XML and have it display in browsers that way.