Quick Start to XML, a classic introduction to xml

Source: Internet
Author: User

Quick Start to XML, a classic introduction to xml

What is XML?

Extensible Markup Language

Custom tags;

Used to transmit data;

Extensible Markup Language is a markup language similar to hypertext markup language.


Comparison with HTML:

1. It is not used to replace HTML;

XML is a supplement to HTML

2. Different purposes

HTML displays data, and XML contains and transmits data.

3. different syntaxes

Not all HTML tags appear in pairs. XML must appear in pairs and be case sensitive.


* Syntax rules to be followed for well-formatted XML:

1) The root element must exist.

2) tags must be disabled.

3) mark case sensitive

4) elements must be correctly nested.

5) The attribute must be enclosed in quotation marks.



XML specifications-DTD and Schema

1. DTD

Document Type Definition

Defines the file structure and provides syntax rules. You can choose to use the structure.

Usage: built-in and external calls.

2. Schema

It also describes the structure of the document and replaces the DTD, which is more powerful than the DTD.

Protects data communication.

<? Xml version = "1.0" encoding = "gb2312"?> <! -- Declaration --> <! DOCTYPE personal SYSTEM "staff. dtd"> <! -- Call the DTD file --> <personal> <! -- Root element --> <department id = "Marketing department"> <! -- Sub-element --> <employee> <name> Dan </name> <title> Manager </title> <staff> </employee> <name> Amy </name> <title> employee </title> <staff> </employee> </department> <department id = "Marketing department"> <employee> <name> Jena </name> <title> Manager </title> </employee> <name> Sarah </name> <title> employee </title> </employee> </department> </personal>

Document Tree


XML is just getting started. Like HTML, I just learned something. You also need to learn more and practice more. After practice, we can gain a deeper understanding of the role of XML and its unique functions.

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.