XML Easy Learning Manual (2)

Source: Internet
Author: User
Tags date format closing tag manual first row
Xml Five. The difference between XML and HTML -->

Both XML and HTML come from SGML, they all contain tags, have similar syntax, and the biggest difference between HTML and XML is that HTML is a stereotyped markup language that is described with intrinsic markup to display Web page content. For example < h1> represents the first row of headings, with a fixed size. In contrast, XML does not have a fixed tag, XML can not describe the specific appearance of the Web page, content, it is just describing the content of the data form and structure.

This is a qualitative distinction: the Web page mixes the data with the display, while XML separates the data from the display.

We look at the example above, in myfile.htm, we only care about the way the page is displayed, we can design different interfaces, layout the page in different ways, but the data is stored in the Myfile.xml without any change.

(If you're a programmer, you'll be surprised to find that this is very similar to the idea of modular object-oriented programming!) In fact, the Web page is not a procedure? )

It is this distinction that makes XML easy, efficient and scalable in network applications and information sharing. Therefore, we believe that XML as an advanced data processing method, will make the network across to a new realm.

Six. Strict format of XML

Drawing on the lessons of the loose HTML format, XML insists on a "good format" from the start.

Let's look at some of the HTML statements that are visible in HTML:

1.

Sample


2.< b>< i>sample</b></i>


3.< td>sample</td>


4.< Font color=red>samplar</font>


In an XML document, the syntax of several of these statements is incorrect. Because:

1. All markings must have a corresponding closing tag;

2. All XML tags must be properly nested;

3. All XML tags are case-sensitive;

4. All marked attributes must be enclosed in "";

So the above statement is correctly written in XML

1.

Sample




2.< b>< i>sample</i></b>


3.< td>sample</td>


4.< font color= "Red" >samplar</font>


In addition, XML tags must follow the following naming conventions:

1. The name may contain letters, numbers and other letters;

2. Name cannot begin with number or "_" (underline);

3. Names cannot begin with the letter XML (or XML or XML ...);

4. The name cannot contain spaces.

Any error in the XML document results in the same result: The Web page cannot be displayed. Browser developers have reached an agreement to implement rigorous and critical parsing of XML, and any minor errors will be reported. You can change the above myfile.xml, for example, change the < email> to < Email>, and then open myfile.xml directly with IE5, and get an error message page:


<?xml version= "1.0" encoding= "GB2312"?>

<myfile>

<title>xml Easy Learning Handbook </title>

<author>ajie</author>

<Email>ajie@aolhoo.com</email>

<date>20010115</date>

</myfile>

Seven. More about XML

Well, by now you already know:

1. what is XML;

The relationship and distinction between 2.XML,HTML,SGML;

3.XML of simple application.

Congratulations to you! You are no longer ignorant of XML and are at the forefront of web technology. The whole learning process seems not very difficult oh:

Such as



Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.