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.