Display XML

In all modern browsers, you can view the original XML files.

Don't expect XML files to be displayed directly as HTML pages.

View XML File

<?xml version="1.0" encoding="UTF-8"?>
- <note>
  <to>George</to>
  <from>John</from>
  <heading>Reminder</heading>
  <body>Don't forget the meeting!</body>
</note>

View the above XML file in the browser:note.xml

XML documents will be displayed as root elements and child elements with code coloring.

By clicking the plus or minus sign on the left side of an element, you can expand or collapse the structure of the element.

To view the original XML, please right-click on the page and then select 'View Source Code'.

Note:In Safari 5 (and earlier versions), only the element text is displayed. To view the original XML, you must right-click on the page and select 'View Source Code'.

View Invalid XML Files

If you open an incorrect XML file, some browsers will report an error, some browsers will display it, or display it incorrectly.

<?xml version="1.0" encoding="UTF-8"?>
- <note>
  <to>George</to>
  <From>John</from>
  <heading>Reminder</heading>
  <body>Don't forget the meeting!</body>
</note>

Please try to open this XML file: note_error.xml

Other XML Examples

Please view these XML documents, which will help you build a sensory understanding of XML.

XML Breakfast Menu
This is the breakfast menu of a restaurant, stored in XML format.
XML CD Catalog
This is my CD collection, stored in XML format.
XML Plant Catalog
This is a plant catalog from a gardening store, stored in XML format.

Why does XML display like this?

XML documents do not carry information about how to display data.

Since XML tags are 'invented' by the author of the XML document, browsers cannot determine whether a tag like <table> describes an HTML table or a dining table.

Without any information about how to display the data, most browsers will simply display the XML document as source code.

Tip:If you want to set the style of an XML document, please use XSLT.