当前位置:网站首页>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
边栏推荐
- Global and Chinese market of water heater expansion tank 2022-2028: Research Report on technology, participants, trends, market size and share
- 数据库遇到的问题
- How much do you know about the bank deposit business that software test engineers must know?
- About the slmgr command
- FFT 学习笔记(自认为详细)
- [Chongqing Guangdong education] reference materials for Zhengzhou Vocational College of finance, taxation and finance to play around the E-era
- LeetCode 6006. Take out the least number of magic beans
- State mode design procedure: Heroes in the game can rest, defend, attack normally and attack skills according to different physical strength values.
- PHP determines whether an array contains the value of another array
- [designmode] Decorator Pattern
猜你喜欢
传输层协议------UDP协议
Search (DFS and BFS)
PV static creation and dynamic creation
【DesignMode】组合模式(composite mode)
Configuring OSPF GR features for Huawei devices
[noi simulation] Anaid's tree (Mobius inversion, exponential generating function, Ehrlich sieve, virtual tree)
Determinant learning notes (I)
单商户V4.4,初心未变,实力依旧!
如何利用Flutter框架开发运行小程序
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
随机推荐
What are Yunna's fixed asset management systems?
如何解决ecology9.0执行导入流程流程产生的问题
[designmode] composite mode
Mysql - CRUD
常用API类及异常体系
建立时间和保持时间的模型分析
STM32 configuration after chip replacement and possible errors
Global and Chinese market of digital serial inverter 2022-2028: Research Report on technology, participants, trends, market size and share
Miaochai Weekly - 8
FFT 学习笔记(自认为详细)
MySQL存储引擎
云呐|固定资产管理系统功能包括哪些?
FFMPEG关键结构体——AVFormatContext
Codeforces round 804 (Div. 2) [competition record]
电机的简介
第16章 OAuth2AuthorizationRequestRedirectWebFilter源码解析
Start from the bottom structure and learn the introduction of fpga---fifo IP core and its key parameters
SQLServer连接数据库读取中文乱码问题解决
AtCoder Beginner Contest 254【VP记录】
NSSA area where OSPF is configured for Huawei equipment