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

边栏推荐
- Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
- Introduction to C language -- array
- 21_ Redis_ Analysis of redis cache penetration and avalanche
- MFC 控制台打印,弹出对话框
- CDN 在游戏领域的应用
- C语言中的printf函数和scanf函数
- C RichTextBox controls the maximum number of lines displayed
- LeetCode 2310. The number of digits is the sum of integers of K
- Base64 coding can be understood this way
- Introduction to mathjax (web display of mathematical formulas, vector)
猜你喜欢

电脑怎么设置扬声器播放麦克风的声音

Mavn builds nexus private server

Base64 coding can be understood this way

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

Btrace- (bytecode) dynamic tracking tool

Introduction to C language -- array

How does CTO help the business?

The past and present lives of visual page building tools

Practical debugging skills

解决el-radio-group 回显后不能编辑问题
随机推荐
LeetCode 209. 长度最小的子数组
C thread transfer parameters
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
qml 弹窗框架,可定制
如何对 TiDB 进行 TPC-C 测试
C语言习题---(数组)
C # delay, start the timer in the thread, and obtain the system time
03_线性表_链表
c语言入门--数组
forEach的错误用法,你都学废了吗
LeetCode_滑动窗口_中等_395.至少有 K 个重复字符的最长子串
【NOI模拟赛】伊莉斯elis(贪心,模拟)
数据库内容输出有问题怎么解决
【C语音】详解指针进阶和注意点(2)
N皇后问题的解决
记一次面试
Jenkins Pipeline 应用与实践
btrace-(字节码)动态跟踪工具
Table responsive layout tips
How to solve the problem of database content output