当前位置:网站首页>XML Configuration File
XML Configuration File
2022-07-06 00:21:00 【16000 mu of roses that turn the world upside down】
Preface :(*゚ヮ゚)* I wrote this article with XML Relevant basic knowledge , Next, I will write a few more articles about XML The article , Interested families can have a look ヾ(•ω•`)o
Catalog
XML Format
What is? XML?
eXtensible Markup Language (XML) Extensible markup language ( A subset of Standard General Markup Languages ) It is a simple data storage language .
Use a series of simple tags to describe the data , And these tags can be created in a convenient way , Although extensible markup language takes up more space than binary data , But extensible markup language is extremely simple and easy to master and use .
Extensible markup language ( A subset of Standard General Markup Languages )
———— Baidu Encyclopedia
XML The role of
(XML The source of the original text is Baidu Library https://wenku.baidu.com/view/47802df483eb6294dd88d0d233d4b14e85243ee8.html)
1. Data exchange
⽤XML In response to ⽤ It's no secret that programs exchange data with companies , Milli ⽆ Questions should be listed as ⼀ position .
So why XML In this field ⾥ Your position is so important ? The reason is that XML send ⽤ Elements and attributes to describe numbers
According to the . In the process of data transmission ,XML Always keep things like ⽗/⼦ Data structures like relationships .⼏ One should ⽤ Program
You can share and resolve the same ⼀ individual XML⽂ Pieces of , There is no need to make ⽤ Traditional string parsing or disassembly process .
contrary , Ordinary ⽂ Pieces do not describe each data segment ( Except in the head ⽂ In the piece ), Nor does it preserve the data relational structure . send
⽤XML Doing data exchange can make ⽤ The program is more flexible , Because it can ⽤ Location ( And ordinary ⽂ Pieces of ⼀ sample ) or ⽤ element
Prime name ( From database ) To access XML data .
2.Web service
Web Service is the most important ⼈ Excited ⾰ Life is ⼀, It makes ⽤ Different systems and different programming languages ⾔ Of ⼈ We can communicate with each other
Stream and share data . It is based on Web The server ⽤XML Exchange data between systems . Exchanging data usually ⽤XML mark
remember , It can standardize the agreement ⼀ Cause ,⽐ For example, in the simple object processing protocol (Simple Object Access Protoc
ol, SOAP) On the platform .
SOAP Can be in ⽤ Different programming languages ⾔ Passing messages between constructed objects . It means ⼀ individual C# Objects can be associated with ⼀ individual
Java Object into ⾏ Communications . This kind of communication is very ⾄ Can send ⽣ In transit ⾏ Between objects on different operating systems .DCOM
, CORBA or Java RMI Messages can only be passed between tightly coupled objects ,SOAP Can be passed between loosely coupled objects
Deliver a message .
3. Content management
XML only ⽤ Elements and attributes to describe data ,⽽ Do not provide data display ⽰⽅ Law . such ,XML Provided. ⼀ The best
Elegant ⽅ FA Lai marks Du ⽴ In platform and language ⾔ The content of .
send ⽤ like XSLT Such words ⾔ Can easily XML⽂ Pieces are converted into various formats ⽂ Pieces of ,⽐ Such as HTML, WML, PD
F, flat file, EDI, wait .XML Have the ability to transport ⾏ Between different system platforms and into different formats
⽬ mark ⽂ This piece can ⼒ Make it content management should ⽤ Excellent choice in the system .
4.Web Integrate
Now there are more and more devices ⽀ a XML 了 . bring Web Developers can be in ⼈ electric ⼦ Between assistants and browsers
⽤XML To transfer data .
Why will XML⽂ Ben sent it directly to such a device ? In this way ⽬ What's important is to let ⽤ More households ⾃⼰ Master the data
display ⽰⽅ type , Can experience the happiness of practice more . Regular customers / service (C/S)⽅ Formula in order to get data sorting or more
Fade ⽰ Format , You must send an application to the server ;⽽XML Data can be processed directly , There is no need to apply to the server
Please check - Return the result in such a two-way “ Journey ”, At the same time, the equipment does not need to configure the database .
what ⾄ It can also be used for XML⽂ Piece in ⾏ Modify and return the result to the server . Imagine ⼀ Next ,⼀ The platform has mutual
United ⽹ Function and ⽀ a XML How will the refrigerator bring to the market ⼤ The impact of . You don't have to get up early to get it ⽜ milk
了 !
5. Preparation
Many should ⽤ The configuration data is stored in various ⽂ Pieces of ⾥,⽐ Such as .INI⽂ Pieces of . In spite of this ⽂ The file format has made
⽤ For many years and ⼀ Straight good ⽤, however XML Or better ⽅ The formula should be ⽤ Program mark configuration data . send ⽤.
NET⾥ Class , Such as XmlDocument and XmlTextReader, Mark the configuration data as XML Format , Can make it more
Readability , And can ⽅ Conveniently integrated into the should ⽤ Go to... In the system . send ⽤XML Preparation ⽂ The piece should ⽤ The program can ⽅ Handle conveniently
Data needed , No ⽤ Like other should ⽤ In that way, it can only be modified and maintained after recompiling ⽤ System
The standard XML Format
- There is and only one root element
- XML Labels are case sensitive
- Use the end tag correctly
- Nesting labels correctly
- Legal tag name used
- Define valid properties
Element definition
Case study
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE persons[
<!ELEMENT persons (person+)>
<!ELEMENT person (name,age,contact,br?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT age (#PCDATA)>
<!ELEMENT contact (phone*,email?)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT br EMPTY>
]>
<persons>
<person>
<name> Zhang Xiaoming </name>
<age>10</age>
<contact>
<phone>1234567</phone>
</contact>
<br/>
</person>
<person>
<name> Zhang Daming </name>
<age>35</age>
<contact>
<email>[email protected]</email>
</contact>
</person>
</persons>
Attribute definitions
Case study
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE persons[
<!ELEMENT persons (person+)>
<!ELEMENT person (name,age,contact,br?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT age (#PCDATA)>
<!ELEMENT contact (phone*,email?)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT br EMPTY>
<!-- Attribute definitions -->
<!ATTLIST person
pid ID #REQUIRED
sex ( male | Woman ) ' male '
qq CDATA #IMPLIED
parent IDREF #IMPLIED
>
]>
<persons>
<person pid="p1" sex=" male " qq="aaa" parent="p2">
<name> Zhang Xiaoming </name>
<age>10</age>
<contact>
<phone>1234567</phone>
</contact>
<br/>
</person>
<person pid="p2">
<name> Zhang Daming </name>
<age>35</age>
<contact>
<email>[email protected]</email>
</contact>
</person>
</persons>
This article ends here , Next
边栏推荐
- Problems encountered in the database
- [Chongqing Guangdong education] reference materials for Zhengzhou Vocational College of finance, taxation and finance to play around the E-era
- [online chat] the original wechat applet can also reply to Facebook homepage messages!
- Global and Chinese markets of universal milling machines 2022-2028: Research Report on technology, participants, trends, market size and share
- anconda下载+添加清华+tensorflow 安装+No module named ‘tensorflow‘+KernelRestarter: restart failed,内核重启失败
- Doppler effect (Doppler shift)
- Codeforces gr19 D (think more about why the first-hand value range is 100, JLS yyds)
- FFT 学习笔记(自认为详细)
- MDK debug时设置数据实时更新
- 【QT】Qt使用QJson生成json文件并保存
猜你喜欢
What are Yunna's fixed asset management systems?
Teach you to run uni app with simulator on hbuilderx, conscience teaching!!!
选择致敬持续奋斗背后的精神——对话威尔价值观【第四期】
MySql——CRUD
数据分析思维分析方法和业务知识——分析方法(三)
Recognize the small experiment of extracting and displaying Mel spectrum (observe the difference between different y_axis and x_axis)
[designmode] composite mode
uniapp开发,打包成H5部署到服务器
Huawei equipment is configured with OSPF and BFD linkage
MDK debug时设置数据实时更新
随机推荐
Gd32f4xx UIP protocol stack migration record
【线上小工具】开发过程中会用到的线上小工具合集
The global and Chinese markets of dial indicator calipers 2022-2028: Research Report on technology, participants, trends, market size and share
anconda下载+添加清华+tensorflow 安装+No module named ‘tensorflow‘+KernelRestarter: restart failed,内核重启失败
18. (ArcGIS API for JS) ArcGIS API for JS point collection (sketchviewmodel)
如何利用Flutter框架开发运行小程序
Pointer - character pointer
FFMPEG关键结构体——AVFrame
AtCoder Beginner Contest 254【VP记录】
N1 # if you work on a metauniverse product [metauniverse · interdisciplinary] Season 2 S2
Notepad++ regular expression replacement string
Search (DFS and BFS)
Gavin teacher's perception of transformer live class - rasa project actual combat e-commerce retail customer service intelligent business dialogue robot system behavior analysis and project summary (4
LeetCode 6006. Take out the least number of magic beans
LeetCode 斐波那契序列
JS 这次真的可以禁止常量修改了!
PHP determines whether an array contains the value of another array
Global and Chinese markets of POM plastic gears 2022-2028: Research Report on technology, participants, trends, market size and share
[noi simulation] Anaid's tree (Mobius inversion, exponential generating function, Ehrlich sieve, virtual tree)
剖面测量之提取剖面数据