当前位置:网站首页>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

边栏推荐
- Printf function and scanf function in C language
- Tidb data migration scenario overview
- 【NOI模拟赛】刮痧(动态规划)
- Sharp tool SPL for post SQL calculation
- 05_ queue
- 【无标题】LeetCode 2321. 拼接数组的最大分数
- 电脑怎么设置扬声器播放麦克风的声音
- How to test tidb with sysbench
- Arithmetic operations and related exercises in C language
- Base64 编码原来还可以这么理解
猜你喜欢

Dragonfly low code security tool platform development path

btrace-(字节码)动态跟踪工具

geoserver离线地图服务搭建和图层发布

为什么只会编程的程序员无法成为优秀的开发者?

21_ Redis_ Analysis of redis cache penetration and avalanche

18_Redis_Redis主从复制&&集群搭建

Li Chuang EDA learning notes 15: draw border or import border (DXF file)

【NOI模拟赛】伊莉斯elis(贪心,模拟)

Introduction to mathjax (web display of mathematical formulas, vector)

Set set you don't know
随机推荐
Huawei interview question: no palindrome string
Leetcode - Search 2D matrix
CTO如何帮助业务?
C # delay, start the timer in the thread, and obtain the system time
.NET Core 日志系统
php获取数组中键值最大数组项的索引值的方法
Jenkins Pipeline 应用与实践
【NOI模拟赛】伊莉斯elis(贪心,模拟)
【无标题】LeetCode 2321. 拼接数组的最大分数
Record an interview
qml 弹窗框架,可定制
06_栈和队列转换
[C language] explain the initial and advanced levels of the pointer and points for attention (1)
[QNX hypervisor 2.2 user manual]6.3 communication between guest and external
List集合&UML图
TiDB 环境与系统配置检查
871. Minimum refueling times: simple priority queue (heap) greedy question
The past and present lives of visual page building tools
Topology architecture of the minimum deployment of tidb cluster
TiDB数据迁移场景综述