It is a well-known fact that you cannot view XML documents on its own, because it has not style information. There are only two ways to view XML documents on screen.
- Display in web browser like you do for webpages.
- Convert the XML information into HTML for display.
It is true that there is no style information with XML still it is visible in the browser when you open the doc.
Hierarchical View
The XML document can be viewed in any browser, without any style information. Only the hierarchies of elements and tags are visible.
When you open the XML in hierarchical view, only the outline of the document is visible and a warning indicating that no stylesheet is being rendered.
XHTML Viewing
The XHTML is another standard that conforms to the XML strict standards, and it has some formatting for elements. It guarantees that the information and tags are well-formed before rendering the style information.
In the above example, I have tried to open the XML information from an XHTML document, and it hides the hierarchical view of XML and present a built-in style for XML data. Note how, address field is italicized, and course information is in bold.
Customized Software to Read XML information
Not all information can be rendered through XML, because XML itself helps create other markup languages. Some software is required to show the custom information.
Jumbo software uses Chemical Markup Language to display molecule structure , Math ML shows formulas through XML and MathML extension is required to display that kind of information.
You can visit MathML website for more information: MathML Core (w3c.github.io)
General Purpose Browsers
A browser is the ultimate destination to view HTML or XML files, if not consumed by an application. There are several general-purpose browsers and I cannot list them all, which support XML technologies.
- Google Chrome
- Mozilla Firefox
- Opera
- Microsoft Edge (Internet Explorer)
- Amaya
- Safari
Summary
In this article, you have learned ways to view XML document with or without style information. The browser choice or technique is your decision, and you must choose according to your need and satisfaction.