ViewXML Files
In all major browsers, you can view the original XML file.
Don't expect XML files to be displayed as HTML pages directly.
View XML Files
|
<?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
XML documents will be displayed as code-colored roots and child elements. 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 source (without the + and - signs), select "View Page Source" or "View Source" from the browser menu.
Note:In Safari, only the text of elements will be displayed. To view the original XML, you must right-click 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 look at these XML documents; this will help you build an intuitive 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 store, stored as XML data.
A Simple Food Menu
This is a breakfast menu from a restaurant, stored as XML data.
Why does XML look like this?
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 <table> describes an HTML table or a dining table.
Without any information on how to display the data, most browsers will just 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.
Other Extensions