Please visit our sponsors !
Viewing XML Files
Raw XML files can be viewed in IE 5.0 (and higher) and in
Netscape 6,
but to make it display like a web page, you have to add some display
information.
Viewing XML Files
To view an XML document in IE 5.0 (and higher) you can click on a
link, type the URL in the address bar, or double-click on the name of an XML
file in a files folder. If you open an XML document in IE, it will display the document with color
coded root
and child elements. A plus (+) or minus sign
(-)
to the left
of the elements can be clicked to expand
or collapse the element structure. If you want to view the raw XML source, you must select "View Source" from the browser menu.
To view an XML document in Netscape 6 you'll have to open the XML file and
then right-click in XML file and select "View Page Source". If you open an XML document in
Netscape 6, it will display the document with color
coded root
and child elements.
Look at this XML file: note.xml
Note: Do not expect XML files to be formatted like an HTML document !
Viewing an invalid XML file
If an erroneous XML file is opened, the browser will report the error.
Look at this XML file:
note_error.xml
Other Examples
Viewing some XML documents will help you get the XML feeling.
We have collected the following XML
data files for you:
An XML CD catalog
This is my fathers CD collection, stored as XML data (old and boring titles
I think).
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 food menu from a restaurant, stored as XML data.
Why does XML display 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, browsers do not know if a tag like <table> describes an HTML
table or a dining table.
Without any information about how to display the data, most browsers will
just display the XML document as it is.
In the next chapters, we will take a look at different solutions to the
display problem, using CSS, XSL, JavaScript, and XML Data Islands.
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|