The original XML file can be viewed in all major browsers.
Don't expect XML files to be displayed directly as HTML pages.
View XML file
##<?xml version="1.0" encoding="ISO-8859-1 "?> - <note> < ;to>Tove</to> <from>Jani</#from> <heading>Reminder< ;/heading> <body>Don't forget me this weekend!</body> </note> |
View this XML file: note.xml
The XML document will be displayed as code-colored root and child elements. You can expand or collapse the structure of an element by clicking the plus sign (+) or minus sign (-) to the left of the element. To view the raw XML source (excluding the + and - symbols), select "View Page Source" or "View Source" from the browser menu.
Note: In Safari, only the text of the element will be displayed. To view the raw XML, you must right-click on the page and select "View Source".
View invalid XML files
If an incorrect XML file is opened, the browser will report an error.
Please view this XML file: note_error.xml
Other XML examples
Please view these XML documents, which will help you build your perception of XML know.
An XML CD directory
This is a CD set stored as XML data.
An XML plant catalog
This is a plant catalog from a plant store, stored as XML data.
A simple food menu
This is a breakfast menu from a restaurant, stored as XML data.
Why does the XML look like this?
XML documents do not carry information about how to display the data.
Because XML tags were "invented" by the author of the XML document, the browser cannot determine whether a tag like <table> describes an HTML table or a dining table.
Most browsers will simply display an XML document as source code without any information about how to display the data.
In the following sections, we will look at several solutions to this display problem, using CSS, XSLT and JavaScript.