Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

View the XML file

View the XML file


Raw XML files can be viewed in all major browsers.

Do not expect an XML file to be displayed directly as an HTML page.


View the XML file

|

- <note>
<to>Toveto>
<from>Janifrom>
<heading>Reminderheading>
<body>Don't forget me this weekend!body>
note>
| | --- |

View this XML file:note.xml

An XML document will be displayed as a color-coded root and child elements. By clicking the plus (+) or minus (-) sign to the left of an element, you can expand or collapse its structure. To view the raw XML source (without the + and - signs), choose \"View Page Source\" or \"View Source\" from the browser menu.

**Note:** In Safari, only the text of the elements is displayed. To view the raw XML, you must right-click the page and select \"View Source\".


Viewing an invalid XML file

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; this will help you develop a perceptual understanding of XML.

An XML CD catalog
This is a CD collection stored as XML data.

An XML plant catalog
This is a plant catalog from a plant shop, stored as XML data.

A simple food menu
This is a breakfast menu from a restaurant, stored as XML data.


Why does XML display this way?

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

Since XML tags are \"invented\" by the author of the XML document, the browser cannot determine whether a tag like

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

In the following chapters, we will look at several solutions to this display problem, using CSS, XSLT, and JavaScript.

actually describes an HTML table or a dining table.