XML Guide--Viewing XML file _xml basics

Source: Internet
Author: User

The original XML file can be viewed with IE 5.0 (or later) or Netscape 6来, but you must add some additional display information if you want the XML document to appear like a Web page.



viewing XML files
We can use IE5.0 (or later) to browse the XML document. You can click a hyperlink or enter the URL address in the browser's address bar, or double-click the XML document in the folder. If you open an XML document with IE, you find that the browser uses the color-labeled root element and child element of the XML document, there is a "+" number on the left side of the XML element, so you can click the "+" number to expand the next level of the element, and if the element has a "-" number on the left, you can also click this "- "Number, fold the next level of the structure of this element, if you are willing to view the XML document source file, then you can select" See Source File "in the right-click menu.
We can also open the XML document with Netscape 6来, and we can also use the right button to select "View Source." When you open an XML document with Netscape 6, the browser will display the root element and the child elements with colored code.

<?xml version= "1.0" encoding= "Iso-8859-1"?>
-<!--
Edited with XML Spy v4.2
-->
-<breakfast_menu>
-<food>
<name>belgian waffles</name>
<price>$5.95</price>
<description>two famous Belgian waffles with plenty to real maple syrup</description>
<calories>650</calories>
</food>
-<food>
<name>strawberry Belgian waffles</name>
<price>$7.95</price>
<description>light Belgian waffles covered with strawberries whipped and cream</description>
<calories>900</calories>
</food>
-<food>
<name>berry-berry Belgian waffles</name>
<price>$8.95</price>
<description>light Belgian Waffles covered with an assortment of fresh berries and whipped
<calories>900</calories>
</food>
-<food>
<name>french toast</name>
<price>$4.50</price>
<description>thick slices made from our homemade sourdough bread</description>
<calories>600</calories>
</food>
-<food>
<name>homestyle breakfast</name>
<price>$6.95</price>
<description>two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
<calories>950</calories>
</food>
</breakfast_menu>
Why does XML appear in browsers this way?
A simple XML document does not contain information about how to display the data.
Since XML tags are "created" and "invented" by XML document authors, it is impossible to know whether a <table> tag refers to a table in HTML or a wooden table.
In the absence of any additional information indicating how data is displayed, IE browsers typically display XML data as a tree view.
In the passing section below, we will describe some solutions to the problem of XML document display, including CSS, XSL, JavaScript, and XML data islands.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.