Xml: xml

Source: Internet
Author: User
Tags xml example

Xml: xml
Following the footsteps of xiaobian, today I will briefly summarize the present and future of xml. xml Baidu encyclopedia has interpreted it as follows: ExtensibleMarkup Language (XML ), it is used to mark electronic files so that they have a structured markup language. It can be used to mark data and define data types. It is a source language that allows users to define their own markup language. XML is designed to transmit and store data.

XML is a subset of the standard General Markup Language (SGML) and is suitable for Web transmission. XML provides a unified way to describe and exchange structured data independent of applications or vendors. In this blog post today, I will briefly summarize the knowledge points of the xml learning video provided by Mr. Liu Wei. Then, what is xml for the small series? The characteristics of xml, the differences and links between xml and html, and the detailed introduction of xml in the present and Present Aspects of DTD and Schema. The first is a summary of Liu Wei's xml video:

Let's take a look at the path of xml in this article and start to introduce xml in detail:

1. What is xml

XML is An Extensible Markup Language (XML ). XML focuses on data exchange and is used to exchange and store data between different platforms or applications.

Ii. xml features

A. XML uses the Unicode Character Set to generate multiple languages, including English, Chinese, Greek, and Sanskrit.

B. Multiple sources (including other XML documents and binary files) can be merged into an XML document.

C. You can use DTD or Schema to manage consistency issues. DTD is mainly used for document-type documents, and Schema mainly uses data-type documents.

D. It has good scalability and can define its own elements and attributes.

E. Data can be extracted from the relational database management system to structured documents through XML. It is also designed to operate various data objects.

F. In a well-designed XML application, XML markup does not involve how documents are displayed, but only indicates the structure of documents.
Xml is designed to store, support, and exchange data, rather than display data. XML is usually used for data exchange, rather than data storage. Xml is a unified format for electronic data exchange.

Iii. xml pk html

Link

A. xml is not a technology used to replace html.

B. xml and html are designed for different purposes

C. The core of xml design is to include and transmit data.

D. The core of html design is to display data.

E. Both of them are Markup languages (ML). One is hypertext markup language and the other is Extended Markup Language.

Differences

A. Scalability: HTML is not extensible. XML is the original markup language and can be used to define a new markup language.

B. Emphasis: HTML focuses on how information is presented, while XML focuses on how Structured description information is.

C. Syntax requirements: HTML does not require tag nesting, matching, and so on. It does not require a certain order between tags. XML strictly requires nesting and matching, and complies with the DTD tree structure.

D. readability and maintainability: HTML is difficult to read and maintain, while XML structure is clear for ease of reading and Maintenance

Iv. DTD

Overview

DTD (Document Type Definition) defines the structure of an XML file and provides syntax and rules for the XML file. The content can be defined in an XML file, it can also be defined outside the XML file (divided into internal DTD and internal DTD (same effect), and the industry or organization that uses XML for data teaching can define their own DTD.

Category

A. Each XML document can define a DTD separately or be promoted to a public DTD shared by the system.

B. External DTD, A DTD developed by an authority and provided for specific industries or the public.

Syntax

<! Element namecontent>, meaning: NAME indicates the Tag NAME of a standard XML, and CONTENT is the CONTENT model described below.

 

Why use DTD?

A. Using DTD, Each XML file can contain a description of its own format.

B. Through DTD, independent groups can use a standard DTD to exchange data.

C. Your application can also use a standard DTD to verify the data received from the outside.

D. You can also use DTD to verify your data. All in all, the rules can be followed to enable the exchange and performance of XML files according to the DTD.

Content Model introduction:

Test Tool

DTD document of an XML example

<! DOCTYPE Resume [<! -- Indicates that the Resume element contains the child element Name, Email, HomePage, and Publication --> <! ELEMENT Resume (Name, Email, HomePage, Publication)> <! -- Description: the Name, Emal, and HomePage Elements can only contain character data, but cannot contain child elements --> <! ELEMENT Name (# PCDATA)> <! ELEMENT Email (# PCDATA)> <! ELEMENT HomePage (# PCDATA)> <! -- Description: Publication contains the sub-element of the Book --> <! ELEMENT Publication (Book)> <! ELEMENT Book (Title, Pages)>]>
V. Schema

Overview

The Schema mode uses a language similar to XML that includes both global and local declarations. The Schema mode has a complete data type system to define data types in detail. The Schema mode document is a text file independent of the XML document and its extension is. xsd.

Definition and Function

A. Schema describes the structure of xml documents

B. Schema is an xml-based DTD substitution.

C. Schema is also called xml Schema Definition (xsd)

D. The Schema is more powerful than the DTD.

E. Use xml syntax for Schema

F. There are many advantages for compiling a Schema in xml.

No need to learn new languages

You can use the xml editor to edit the Schema file.

You can use an xml parser to parse Schema files.

G. The Schema can contain data communication.

When data is sent from the sender to the receiver, the key point is that both parties should have the same "expectation" for the content"

Use Schema. The sender can describe the data in a way that the receiver can understand.

A type of data, such as "October 5", is interpreted as in some countries, while in other countries

However, an xml Element with data types, such as <date type = "date"> 1992-10-05 </date>, can ensure consistent understanding of the content, this is because the xml data type "date" requires the format of "YYYY-MM-DD"

Test Tool

Xml file using Schema

<?xml version="1.0" encoding="utf-8"?><email xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xsi:noNamespaceSchemaLocation="email.xsd">   <to>liuwei8809@163.com</to>   <from>hellokitty@163.com</from>       <title>loving</title>   <body>I love you forever!</body>   <date>2014-12-7 11:16:32</date></email>
Editor's note: this blog post mainly summarizes the xml video from instructor Liu Wei. The editor mainly divides xml into three major branches: basic, DTD, and Schema. Next, what are the differences between small series and xml? The characteristics of xml, the differences and links between xml and html, and the detailed introduction of xml in the present and Present Aspects of DTD and Schema. As far as small editors understand xml, small editors catch up with xml as pure text files. Any application that can process text files can process them. However, the difference is that some applications can specifically process the elements to display data. To facilitate data transmission, a set of standards are required to unify the data so that the data can be communicated without restrictions. Therefore, the DTD and subsequent Schema modes are available. The storage location is divided into external and internal. B/S learning, To be continued ......

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.