当前位置:网站首页>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
- anconda下载+添加清华+tensorflow 安装+No module named ‘tensorflow‘+KernelRestarter: restart failed,内核重启失败
- 【NOI模拟赛】Anaid 的树(莫比乌斯反演,指数型生成函数,埃氏筛,虚树)
- Power Query数据格式的转换、拆分合并提取、删除重复项、删除错误、转置与反转、透视和逆透视
- MySQL存储引擎
- wx.getLocation(Object object)申请方法,最新版
- 关于slmgr命令的那些事
- [QT] QT uses qjson to generate JSON files and save them
- DEJA_VU3D - Cesium功能集 之 055-国内外各厂商地图服务地址汇总说明
猜你喜欢
Doppler effect (Doppler shift)
notepad++正则表达式替换字符串
NSSA area where OSPF is configured for Huawei equipment
Mathematical model Lotka Volterra
Knowledge about the memory size occupied by the structure
传输层协议------UDP协议
Extracting profile data from profile measurement
wx. Getlocation (object object) application method, latest version
行列式学习笔记(一)
硬件及接口学习总结
随机推荐
FFMPEG关键结构体——AVFrame
Hudi of data Lake (1): introduction to Hudi
Recognize the small experiment of extracting and displaying Mel spectrum (observe the difference between different y_axis and x_axis)
uniapp开发,打包成H5部署到服务器
LeetCode 6005. The minimum operand to make an array an alternating array
Single merchant v4.4 has the same original intention and strength!
从底层结构开始学习FPGA----FIFO IP核及其关键参数介绍
硬件及接口学习总结
权限问题:source .bash_profile permission denied
notepad++正则表达式替换字符串
关于结构体所占内存大小知识
MySql——CRUD
Classic CTF topic about FTP protocol
Pointer pointer array, array pointer
Chapter 16 oauth2authorizationrequestredirectwebfilter source code analysis
PHP determines whether an array contains the value of another array
如何利用Flutter框架开发运行小程序
【DesignMode】组合模式(composite mode)
Leetcode 450 deleting nodes in a binary search tree
FFT learning notes (I think it is detailed)