This is an English translation of the Chinese text.
In all major browsers, you can view the original XML files.
Do not expect XML files to display directly as HTML pages.
Viewing XML Files
| <?xml version="1.0" encoding="ISO-8859-1"?><br> - <note><br> <to>Tove</to><br> <from>Jani</from><br> <heading>Reminder</heading><br> <body>Don't forget me this weekend!</body><br> </note> |
View this XML file: note.xml
The XML document will display as code-colored roots and child elements. By clicking the plus (+) or minus (-) signs on the left side of the elements, you can expand or collapse the element structure. To view the original 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 elements will be displayed. To view the original XML, you must right-click the page and select "View Source."
Viewing Invalid XML Files
If an erroneous 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 develop an intuitive understanding of XML.
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 authors 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.
In the following sections, we will learn about several solutions to this display issue, including the use of CSS, XSLT, and JavaScript.