当前位置:网站首页>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 language exercises - (array)
- info [email protected] : The platform “win32“ is incompatible with this module.
- [C language] explain the initial and advanced levels of the pointer and points for attention (1)
- 04_ Stack
- GeoServer offline map service construction and layer Publishing
- Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
- C# 线程传参
- About text selection in web pages and counting the length of selected text
- [development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)
猜你喜欢
Internet Explorer officially retired
Ad20 cannot select the solution of component packaging in PCB editor
05_队列
LeetCode 2310. 个位数字为 K 的整数之和
geoserver离线地图服务搭建和图层发布
GeoServer offline map service construction and layer Publishing
forEach的错误用法,你都学废了吗
LeetCode 2320. Count the number of ways to place the house
LeetCode 209. Minimum length subarray
为什么只会编程的程序员无法成为优秀的开发者?
随机推荐
TiDB跨数据中心部署拓扑
geoserver离线地图服务搭建和图层发布
Sharp tool SPL for post SQL calculation
数据库内容输出有问题怎么解决
c语言入门--数组
C语言实现N皇后问题
你不知道的Set集合
编译原理课程实践——实现一个初等函数运算语言的解释器或编译器
CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
04_ Stack
Deploy tidb cluster with tiup
LeetCode 2310. 个位数字为 K 的整数之和
GeoServer offline map service construction and layer Publishing
解决el-radio-group 回显后不能编辑问题
N皇后问题的解决
[noi Simulation Competition] scraping (dynamic planning)
Arithmetic operations and related exercises in C language
LeetCode_滑动窗口_中等_395.至少有 K 个重复字符的最长子串
Internet Explorer officially retired
Kityformula editor configure font size and spacing