XML preference series (1)

Source: Internet
Author: User
What should you grasp before learning XML? Below are the basic knowledge you should grasp: 1.WWW, HTML and basic knowledge about web pages 2. several common website scripting languages: JavaScript and VBScript. what is XML? XML stands for EXtensibleMarkupLa What should you grasp before learning XML?
The following are your basic knowledge:
1. WWW, HTML and basic knowledge about webpages
2. several common website scripting languages, such as JavaScript and VBScript

What is XML?
XML stands for EXtensible Markup Language
XML is a language similar to HTML.
XML is a language designed to describe data.
XML is marked in XML (tags, which is similar,Is not pre-defined. you must customize the required tag.
XML is a language that supports self describing.
The XML application DTD (Document Type Definition) is used to display the data.

Important differences between XML and HTML
XML is not an HTML replacement product.
The use of XML and HTML is different.

XML is designed to describe data and focus and data.
HTML is designed to display data and focus and data.

XML is a language for data.
HTML is about how to display information, and XML is about how to describe information.

XML is extensible
All the tags (tags) and document structures in HTML are pre-defined. we only have the right to apply HTML tags of those scales.
XML allows us to customize our own tags and their own document structure.

XML is a supplement to HTML.
It is very important to understand that XML is not a replacement of HTML. what is most likely to happen in the future is
Website developers use XML to describe the data required by the website and the website structure. HTML will be used to visualize and display the data.

Role of XML in future Website Development
We will firmly believe that HTML is the foundation of a website, and XML will become an important feature of website development.
Maybe it will provoke all data processing and transmission

Translation: Batman
Series 2: how to apply XML?

XML can be used to separate your data. your HTML
XML can also be used to retain data within HTML documents.
XML can be used as a form of information exchange.
XML can be used to keep data in a file or database.

The following content is distinguished first:
XML can be used to separate your data. your HTML
HTML pages are used to display data. Therefore, data is generally stored in the HTML page.
The XML data can be stored in a separate XML file.
This method allows you to focus on HTML pattern and display,
And make sure that you do not need to modify the HTML code any time you modify the data.

XML can also be used to retain data within HTML documents.
XML Data can also be treated as 'data island' (Data Island) and stored on the HTML page.
In this way, you can still apply HTML to visualize and display data.

XML can be used as a form of information exchange.
In the real world, the data pattern reserved in computer systems and databases is incompatible.
In many cases, developers face the title of how to exchange the data over the internet.
If we convert the data into XML, the complexity of this job will be greatly reduced.

XML can be used to keep data in a file or database.
Applications can be used to read, write, and display data.

Translation: Batman
Series 3: XML syntax

An example of a simple XML document:


Tove
Jani
Reminder
Don't forget me this weekend!



The first line of the document: an XML name that should be frequently included. it defines the version number of the XML document.
In this example, the document will apply the XML1.0 specification.


The next line defines the first element in the document. The first element is also called the root element:

The following defines the four child elements of the root element (the resolution is to, from, heading, and body ):
Tove
Jani
Reminder
Don't forget me this weekend!

The last line defines the end mark of the root element.


All XML elements must have an end mark.
Some elements in HTML do not need an ending mark.
For example, the following code is justified in HTML:

This is a paragraph

This is another paragraph
However, all elements in XML must have an end tag, for example:

This is a paragraph


This is another paragraph



XML tags are case sensitive.
XML tags are case-sensitive. for example, tags Is different and marked .
The beginning and end of all a tag must be the same case
For example, the following is incorrect.
This is incorrect
This is accurate.
This is correct

Nesting of all XML elements must be accurate
Some elements in HTML can be nested with each other, for example:
This text is bold and italic
However, all nesting in XML must be as follows:
This text is bold and italic

All XML documents must have a root tag
All XML documents must contain a separate root element for marking the definition.
Other elements must be nested in the root element.
All elements can have child elements.
However, child elements must be paired and accurately nested within their parent element.
For example:








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.