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

边栏推荐
猜你喜欢
![[c voice] explain the advanced pointer and points for attention (2)](/img/fb/515e25899bd9a2905ee63cb041934a.png)
[c voice] explain the advanced pointer and points for attention (2)

C language exercises - (array)

Btrace- (bytecode) dynamic tracking tool

21_ Redis_ Analysis of redis cache penetration and avalanche

MFC timer usage

Leetcode - Search 2D matrix

Solve the problem that El radio group cannot be edited after echo

C code audit practice + pre knowledge

LeetCode 209. 长度最小的子数组

【C语音】详解指针进阶和注意点(2)
随机推荐
C语言习题---(数组)
IE 浏览器正式退休
C语言中的printf函数和scanf函数
你不知道的Set集合
Application of CDN in game field
如何对 TiDB 进行 TPC-C 测试
MFC console printing, pop-up dialog box
Tidb hybrid deployment topology
How does CTO help the business?
How to conduct TPC-C test on tidb
Topology architecture of the minimum deployment of tidb cluster
07_哈希
Mavn 搭建 Nexus 私服
.NET Core 日志系统
Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
Dragonfly low code security tool platform development path
05_队列
21_Redis_浅析Redis缓存穿透和雪崩
List集合&UML图
Arithmetic operations and related exercises in C language