当前位置:网站首页>XML Configuration File
XML Configuration File
2022-07-02 15:14:00 【Xiao afai_】
Believe in XML No stranger to developers , that , What is? XML Well ?XML What's the use ? How to use XML Well ? I believe you will have the answer after reading this article
This issue is wonderful
XML Example of attribute definition
The classification of elements
The limit of the number of elements
XML Introduce
XML What is it?
Extensible Markup Language( Extensible markup language ), abbreviation XML
Extensible markup language :
1、 Mark , It refers to the information symbols that the computer can understand
2、 By such a mark , Computers can deal with articles containing all kinds of information
XML yes A format , It's a kind of Simple data storage language , It is also a commonly used configuration file
Use a series of simple tags to describe the data , And these tags can be created in a convenient way , The syntax format is strict , Although extensible markup language takes up more space than binary data , But extensible markup language is extremely simple and easy to master and use
XML The role of
- Configuration file as a project or template
- As the format of network transmission data ( Now JSON Mainly ).
- To hold data , And the data are self descriptive
Why study XML

- Extensible markup language is extremely simple and easy to master and use
- The syntax format is strict , Is a common configuration file
- XML Inside DTD( Now let's talk about ) Specifications can be defined , The function is equivalent to interface , That is, only by using this specification can we realize XML The function of
XML Attribute definitions
grammar
- < !ATTLIST element-name att_name type desc >
Attribute types
- ID: If it is written in an element, the element must have ID This attribute
- ( male | Woman ): Attributes can only be male or female , Write other errors
- CDATA: Text attribute
- IDREF: Quote someone else ID Value of label
- reference( To use less )
Property description
- #REQUIRED: It means required
- #IMPLIED: Means not required
- ' The default value is ': Only type When it is male or female ,desc Can use the default value
XML Example of attribute definition
Make a statement person Property specification of object

XML The element definition of
1、DTD Definition
DTD brief introduction
DTD( Document type definition ) The function of is to define XML The legal building blocks of documents
DTD It can be expressed in lines XML In the document , It can also be used as an external reference
DTD The label of :< !DOCTYPE root[ ] >
DTD Specification example of
<!DOCTYPE NEWSPAPER [
<!ELEMENT NEWSPAPER (ARTICLE+)>
<!ELEMENT ARTICLE (HEADLINE,BYLINE,LEAD,BODY,NOTES)>
<!ELEMENT HEADLINE (#PCDATA)>
<!ELEMENT BYLINE (#PCDATA)>
<!ELEMENT LEAD (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
<!ELEMENT NOTES (#PCDATA)>
<!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED>
<!ATTLIST ARTICLE EDITOR CDATA #IMPLIED>
<!ATTLIST ARTICLE DATE CDATA #IMPLIED>
<!ATTLIST ARTICLE EDITION CDATA #IMPLIED>
]>2、 Element definition
The classification of elements
< !DOCTYPE element-name EMPTY>// Empty elements
< !DOCTYPE element-name (#PCDATA)>// Text elements
< !DOCTYPE element-name (e1,e2)>// Mixed elements notes : An empty element refers to an element without a label body ( Photo label ), Such as </a>; Mixed elements refer to multiple different elements in an element , Such as <head> <h1> <sex> </sex> </h1></head>; Text elements are tags that can be passed in text types , Such as Chinese 、 Letter 、 Numbers etc.
The limit of the number of elements
- And : use . Express
- Not : use | Express
frequency :
- 0 or 1: use ? Express
- 0 or N: use * Express
- 1 or N: use + Express
Example of element definition
Definition person Elements in objects and element specifications

边栏推荐
- Base64 编码原来还可以这么理解
- Sharp tool SPL for post SQL calculation
- How to solve the problem of database content output
- 使用 TiUP 部署 TiDB 集群
- MFC 控制台打印,弹出对话框
- 数据库内容输出有问题怎么解决
- TiDB 集群最小部署的拓扑架构
- Principles, language, compilation, interpretation
- CDN 在游戏领域的应用
- Points clés de l'examen de principe de compilation pour l'année scolaire 2021 - 2022 [Université chinoise d'outre - mer]
猜你喜欢
随机推荐
How to write sensor data into computer database
17_Redis_Redis发布订阅
Tidb cross data center deployment topology
Topology architecture of the minimum deployment of tidb cluster
TiDB 环境与系统配置检查
Base64 编码原来还可以这么理解
LeetCode 2310. The number of digits is the sum of integers of K
05_队列
btrace-(字节码)动态跟踪工具
记一次报错解决经历依赖重复
02_线性表_顺序表
Dragonfly low code security tool platform development path
HUSTPC2022
数据分析思维分析方法和业务知识——业务指标
电脑怎么设置扬声器播放麦克风的声音
C RichTextBox controls the maximum number of lines displayed
[untitled] leetcode 2321 Maximum score of concatenated array
C语言实现N皇后问题
C thread transfer parameters
LeetCode 2320. 统计放置房子的方式数









