Skip to main content

Viewing XML Files

Viewing 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>
Look at this XML file: note.xml
The XML document will be displayed 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. To view the raw XML source (without the + and - signs), select "View Page Source" or "View Source" from the browser menu.
Note: In Safari, only the element text will be displayed. To view the raw XML, you must right click the page and select "View Source"


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 XML Examples

Viewing some XML documents will help you get the XML feeling.
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 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, XSLT and JavaScript.

Comments

Popular posts from this blog

Invigilators caught helping relatives during exams

HYDERABAD: The Chairman Board of Intermediate and Secondary Education (BISE) Hyderabad Abdul Aleem Khanzada, on Monday, detected four invigilators helping their sisters and daughters in cheating during Higher Secondary School Certificate Part-I and Part-II Annual Examinations 2012. According to a spokesman, the Chairman BISE Hyderabad caught these invigilators red handed during his surprise visit to examination centres of Tando Allahyar and Chambar along with his team members. While taking spot action, the Chairman BISE Hyderabad has relieved these four invigilators from the duty of conducting examinations. Besides, he also caught red handed 21 male and female candidates who were engaged in copying in the examinations. The other vigilance committees of the board which conducted surprise visits to Hyderabad, Shaheed Benazirabad, Matiari, Tando Allahyar, Tando Muhammad Khan, Badin, Thatta, Jamshoro and Dadu districts detected 144 male and female candidates engaged in copying during the

Ufone TV Commercials Free To View or Download

30 Second Offer Sim Lagao Offer Ufone Winner Offer