当前位置:网站首页>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
边栏推荐
- Browser local storage
- What is information security? What is included? What is the difference with network security?
- Leetcode 450 deleting nodes in a binary search tree
- FFMPEG关键结构体——AVFormatContext
- Room cannot create an SQLite connection to verify the queries
- FFT 学习笔记(自认为详细)
- 什么叫做信息安全?包含哪些内容?与网络安全有什么区别?
- MDK debug时设置数据实时更新
- [designmode] adapter pattern
- 软件测试工程师必会的银行存款业务,你了解多少?
猜你喜欢

Leetcode:20220213 week race (less bugs, top 10% 555)

Extracting profile data from profile measurement

Go learning - dependency injection

Teach you to run uni app with simulator on hbuilderx, conscience teaching!!!

uniapp开发,打包成H5部署到服务器

Room cannot create an SQLite connection to verify the queries

Knowledge about the memory size occupied by the structure

Classical concurrency problem: the dining problem of philosophers

OpenCV经典100题

关于slmgr命令的那些事
随机推荐
2022.7.5-----leetcode.729
AtCoder Beginner Contest 258【比赛记录】
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
Permission problem: source bash_ profile permission denied
Room cannot create an SQLite connection to verify the queries
【DesignMode】适配器模式(adapter pattern)
Codeforces gr19 D (think more about why the first-hand value range is 100, JLS yyds)
MySql——CRUD
Go learning --- read INI file
Huawei equipment is configured with OSPF and BFD linkage
Pointer pointer array, array pointer
[QT] QT uses qjson to generate JSON files and save them
Codeforces round 804 (Div. 2) [competition record]
Gd32f4xx UIP protocol stack migration record
After summarizing more than 800 kubectl aliases, I'm no longer afraid that I can't remember commands!
【EI会议分享】2022年第三届智能制造与自动化前沿国际会议(CFIMA 2022)
LeetCode 1598. Folder operation log collector
时区的区别及go语言的time库
MySQL之函数
NSSA area where OSPF is configured for Huawei equipment