Learn XML in depth, and systematically grasp the ins and outs of XML

Source: Internet
Author: User
Tags functions
Xml Introduction

XML is a language that allows you to create identities that separate data from formatting from Web pages, and it allows you to store data and share data in a way that makes XML omnipotent. If you want to learn XML in depth, and the system grasps the ins and outs of XML, we first have to go back to the problem of XML concepts. XML (extensible Markup Language), an extensibility identifier language. "Extensibility" identifies "language." Each word clearly identifies the important features and functions of XML. Let's analyze This carefully:

I. Extensibility
Two. Logo
Three. Language
Four. Structured
Five. Meta-data
Six. Show
Seven. DOM

   I. Extensibility---Using XML, you can create your own tags (tags) for your documents.

The first word in XML is "extensibility," which is why XML is powerful and resilient. In HTML, there are a lot of fixed tags that we have to remember and then use, and you can't use tags that are not in the HTML specification. And in XML, you can create any tag you need. You can give full play to your imagination by giving your document some nice tag names. For example, your document contains some introduction to the game, you can create a tag named <game>, and then in <game> under the game category to build <RPG>,<SLG> and other tags. As long as it's clear and easy to understand you can build any number of markers.

You might not get used to it at first, because we are learning HTML, there are fixed tags can be directly learned and used; (a lot of people, including myself, are analyzing other people's code and logo, creating their own web pages), while XML has no tags to learn, and very few documents are the same tags. What are we going to do? Oh, did not create on their own AH. Once you actually start writing XML documents, you'll find it interesting to create new tags at will. You can build your own markup and even build your own HTML language.

Extensibility allows you to have more choices and powerful abilities, but it also creates the problem that you have to learn to plan. You have to understand your own documents, know what parts it consists of, how they relate to each other, and how to identify them.

It also needs to be explained that the identification is a type or feature that describes the data, such as &LT;WIDTH&GT, age <age&gt, name <name> etc, not the content of the data, such as:<10pxl>,<18> ,< John, these are useless tags. If you have studied a database, you can understand that identity is a field name.

   two. Identification---Using XML you can identify the elements in the document.

The second word in XML is "identity," which indicates XML which Kang the  to the brain?

Whether you are HTML or XML, the nature of the logo is easy to understand, if there is no identification, your document on the computer is just a very long string, each word looks the same, there is no emphasis on the points.

By marking, your document is easy to read and understand, you can divide the paragraphs and list the headings. In XML, you can use extensibility to create a more appropriate identity for your document.

However, it is important to note that the identity is only used to identify information, and it does not convey information itself. For example, this HTML code:

<b>frist step<b>
Here <b> represents bold, which is used to show that the "frist step" character is shown in bold,<b> itself does not contain any actual information, while the irresolute bed in wives is bad? Amp;lt;b&gt, the real message is "frist step".

   three. Language---Using XML you have to follow a specific syntax to identify your document.

The third word in XML is "language". This shows that XML as a language must follow certain rules. Although XML extensibility allows you to create new identities, it must still follow a specific structure, syntax, and explicit definition.

In the computer field, language often denotes a quot program language, which is used to programmatically implement functions and applications, but not all languages are programmed, and XML is just a language used to define identity and descriptive information.

Let's take a closer look at the XML application of this principle, may be very boring, but for the overall understanding is very important, you can go through it quickly, the mind has a vague concept, the specific essence of the need to slowly grasp in practice.

  Four. Structured---XML makes the document structured, and all information is arranged in a relational way.

"Structured" sounds too abstract, and as we understand it, it's structured to create a framework for your document, like
Write an outline before writing an article. Structured so that your document does not look cluttered, each part is closely linked to form a whole.

There are two principles of structure:
1. Each part (each element) is associated with other elements. The associated series forms a structure.
2. The meaning of the identity itself is separated from the information it describes.

Let's look at a simple example to help understand:

<?xml version= "1.0" encoding= "GB2312"?>
<myfile>
<title>xml Easy Learning Handbook </title>
<chapter>xml Quick Start
<para> What is xml</para>
<para> benefits of using XML </para>
</chapter>
The concept of <chapter>xml
<para> Extensibility </para>
<para> logo </para>
</chapter>
</myfile>
This is the XML description document for this article, and you can see that the logo is three-level associated, very clear:
<myfile>
<chapter>
<para>
...
</para>
</chapter>
</myfile>

The document structure above, which we call the "document Tree", is the parent element, such as <MYFILE>, and the branches and pages are child elements such as <chapter> and <para>.

[1] [2] Next page



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.