Preface XML is getting hotter and hotter. The basic tutorial on XML is also available on the Internet. However, a lot of concepts and terms are often daunting. many friends ask me: what is the use of XML? do we need to learn it? In my personal learning process
Preface
XML is getting hotter and hotter. The basic tutorial on XML is also available on the Internet. However, a lot of concepts and terms are often daunting. many friends ask me: what is the use of XML? do we need to learn it? I want to write a comprehensive article on the experience and experience of my personal learning process. There are two first points to be determined:
First, XML is the future development trend. whether it is a web designer or a Web programmer, you should learn and understand it in time. waiting will only lead you to lose the opportunity;
2. there are many new concepts for determining new knowledge. you can improve your knowledge by understanding and receiving new knowledge. Don't be afraid and avoid it. after all, we are still young.
Outline
This article is divided into five parts. Resolution is the XML quick entry, XML concept, XML terminology, XML implementation, and XML instance analysis. At last, the appendix first contains the relevant XML resources. From the perspective of common web designers, the author tells you about all aspects of XML in a plain and lively language, helping you open the secrets of XML and quickly step into the new XML category.
Chapter 1 quick XML entry
1. what is XML?
2. is XML a new concept?
3. What are the benefits of applying XML?
4. is XML hard to learn?
V. differences between XML and HTML
VI. strict XML structure
7. More information about XML
1. what is XML?
This is often the first title, and you may not understand it on the first title, because most of the textbooks reply as follows:
XML is short for Extensible Markup Language. This is the definition of scale. So what is a markup language and why is it extensibility? It is a bit confusing. I think it would be better to understand this:
You are very familiar with HTML. it is a Markup Language. remember its full name: "Hypertext Markup Language" Hypertext Markup Language. Understand? At the same time, there are many tags in HTML, such as tags, which are standardized and defined in HTML 4.0. XML allows you to create such tags by yourself, so they are called extensibility.
Here are a few concepts that are easy to mix:
1. XML is not a markup language. It is only used to invent the meta language of a markup language (such as HTML. Day, confused again! It doesn't matter. you only need to know this: XML is different from HTML, and it is more useful than HTML. we will take it into consideration later.
2. XML is not an HTML product. XML is not an HTML upgrade. it is only a supplement to HTML and expands HTML functions. We will continue to apply HTML for a long period of time. (But it is worth noting that the upgraded HTML version XHTML is indeed moving closer to the XML .)
3. you cannot use XML to directly write web pages. Even if XML data is contained, the HTML format must be converted to display on the browser.
The following is an XML Example document (example 1) used to express the information in this document:
XML Quick Start
Ajie
Ajie@aolhoo.com
20010115
Note:
1. this code is just code, so that you can get familiar with XML at first, and it cannot be used in detail;
2. the <title> and <author> statements are self-created tags. they are different from HTML tags. for example, <title> indicates the title of an article, <title> in HTML is the page title.
2. is XML a new concept?
No. XML originated from SGML, a markup language scale earlier than HTML.
For more information about SGML, you only need to have a general concept.
SGML stands for "Standard Generalized Markup Language ). The name indicates the scale of the markup language. that is to say, all markup languages are developed according to SGML and include HTML. SGML has a wide coverage. all files with a certain pattern belong to SGML, such as reports and music scores. HTML is the most common pattern of SGML on the network. Therefore, SGML is the "mother" of HTML ".
XML is a simplified version of SGML, but it only skips the complicated and uncommon parts. (Oh, see! Is the second "mother" in HTML. no wonder it is more powerful than HTML .), Like SGML, XML can also be used in various fields such as finance and scientific research. here we are talking about the application of XML in web.
Here, you should understand that XML is used to create HTML-like markup language and then display information in this markup language.
3. What are the benefits of applying XML?
With HTML, why do we still need XML?
As the network is becoming more and more widely used, it is no longer necessary to rely solely on a single HTML file type to process ever-changing documents and data, and the syntax of HTML itself is not thorough, seriously affects network information transmission and sharing. (Think about how many designer brain cells are broken by browser-compatible titles .) People have already begun to explore how to meet the various usage needs on the network. The application of SGML is acceptable, but SGML is too ambitious, complex programming, so the ultimate choice of "weight loss" SGML---XML as the next generation of web application data transmission and interaction tools.
What are the benefits of using XML? Let's look at the clarification of the w3c organization (XML scale setter:
XML makes the application of SGML on the network more "simple and direct": it simplifies the process of defining file types and simplifies the process of programming and processing SGML files, it simplifies transfer and sharing on the Web.
1. XML can be widely used in any place on the web;
2. XML can meet network utilization needs;
3. the application of XML will make programming simpler;
4. XML is easy to learn and create;
5. the XML code will be clear and easy to browse;
Or abstract. Let's take a look at the strong advantages of XML in subsequent instance tutorials!
4. is XML hard to learn?
If you are interested in learning XML, you may ask: is XML difficult? What is the basis for learning XML?
XML is very simple and easy to learn. If you are familiar with HTML, you will find that the document is very similar to HTML. see the same example document (example 1 ):
? XML version = "1.0"?>
XML Quick Start
Ajie
Ajie@aolhoo.com
20010115
The first line is an XML declaration. The performance document complies with the XML 1.0 specification.
The second line defines the first element in the document, also known as the root element: <myfile>. This is similar to the <HTML> start mark in HTML. Note that this name is customized by yourself.
The following four sub-elements are defined: title, author, email, and date. Differentiate the title, author, email address, and date of the article. Of course, you can define these labels in Chinese, which is easier to understand:
<文章>
<标题> XML easy learning manual
<作者> Ajie
<信箱> Ajie@aolhoo.com
<日期> 20010115
This is the XML document. anyone who is familiar with HTML can directly write such a simple XML document.
In addition, to learn XML, you must also grasp a page scripting language, commonly known as Javascript and VB script. Because XML data is called and interacted in HTML using scripts. Let's take a brief example (example 2 ):
1. Save the following code as myfile.htm