当前位置:网站首页>Brief introduction to XML
Brief introduction to XML
2022-07-26 08:00:00 【Super Qi】
XML
1、XML An introduction to the
1. Concept :
xml Is an extensible markup language .( Extensible means that there are labels that can be customized )
2. effect
To hold data , And these data are self descriptive
It can also be used as the configuration file of the project or module
It can also be used as a network transmission data format ( Now in order to JSON Mainly )
3. grammar
The document statement
Create a xml file
<?xml version="1.0" encoding="UTF-8"?>
The above content is for xml Statement
version Express xml Version of
encoding Express xml The encoding of the file itself
Elements ( label )
xml Element means from ( And includes ) Start tagging until ( And includes ) End the part of the tag
Can include elements other elements 、 Text or a combination of both
Naming rules :
New names can contain letters 、 Numbers and other characters
Names cannot begin with numbers or punctuation
The name cannot be in characters “xml”( perhaps XML、Xml) Start
The name cannot contain spaces
* As short as possible , Don't be too long. . Spaces cannot be included . There are also single labels and double labels
<book sn=“SN54174544” name=" Exorcism sword " author=“ Lin Pingzhi ” price=“9999”/>
<books><!-- books Represents multiple book information -->
<book sn=“SN54174544”> <!-- book Represents a book information sn Property represents the book serial number -->
<name> A brief history of time </name> <!-- name Indicates the title of the book -->
<author> Hawking </author><!-- author The author -->
<price>75</price><!-- price It means the price -->
</book>
</books>
xml attribute
Additional information about labels can be provided , Must use “ ” Lead up . The document must have a root element ( Top level element without parent tag ) And only
<books><!-- books Represents multiple book information -->
<book sn=“SN54174544”> <!-- book Represents a book information sn Property represents the book serial number -->
<name> A brief history of time </name> <!-- name Indicates the title of the book -->
<author> Hawking </author><!-- author The author -->
<price>75</price><!-- price It means the price -->
</book>
</books>
sn For attributes
xml notes
<books><!-- books Represents multiple book information -->
<book sn=“SN54174544”> <!-- book Represents a book information sn Property represents the book serial number -->
<name> A brief history of time </name> <!-- name Indicates the title of the book -->
<author> Hawking </author><!-- author The author -->
<price>75</price><!-- price It means the price -->
</book>
</books>
<!-- book Represents a book information sn Property represents the book serial number --> For comment And html The comments of are the same <!-- -->
Text area (CDATA District )
Format :<![CDATA[ Here you can display the characters you entered as they are , No resolution xml ]]>
effect : You can tell xml Parser , I CDATA The content in the text is pure text , Unwanted xml analysis
<![CDATA[<<<<<<<< sand ]]>
<!-- Inside <<<<<<< Sand is text -->
2、xml Introduction to parsing technology
have access to w3c Organization customized dom Technical analysis

document Object represents the entire document ( It can be html file , It can also be xml file )
3、dom4j Parsing Technology ( a key )
1.dom4j Use of class library ( Go to the official website to download )
2.dom4j Programming steps

3. obtain document object
Guide pack dom4j.jar

Create a SAXReader Input stream , Read out xml Configuration file for , Generate document object
SaxReader.read(“xml Of documents url”);


边栏推荐
- The analysis, solution and development of the problem of router dropping frequently
- Jmeter性能测试之命令行执行和生成测试报告
- Enterprise private network construction and operation and maintenance
- 2021-11-09
- 利用js实现统计字符串数组中各字符串出现的次数,并将其格式化为对象数组。
- JSP implicit object -- scope
- 分布式相关面试题总结
- Fang Wenshan, Jay Chou's best partner, will officially announce "Hualiu yuancosmos" on July 25
- File parsing (JSON parsing)
- Wrong Addition
猜你喜欢

Unity metaverse (II), mixamo & animator hybrid tree and animation fusion

爬虫->TpImgspider
![[fastjson1.2.24 deserialization vulnerability principle code analysis]](/img/14/8f6a75fe5f06c19eeff9c7204979c3.png)
[fastjson1.2.24 deserialization vulnerability principle code analysis]

Practice of online question feedback module (XIV): realize online question answering function

How to close the high-level port

小组成员参加2022中国多媒体大会

Parameterization of JMeter performance test using CSV file

现在开发人员都开始做测试了,是不是以后就没有软件测试人员了?
![[xshell7 free download and installation]](/img/1f/7ac3e2c40c1b3ef2e7ce7403541972.png)
[xshell7 free download and installation]

Jmeter性能测试之将每次接口请求的结果保存到文件中
随机推荐
The difference between abstract classes and interfaces
分布式相关面试题总结
2022.7.22DAY612
Matlab-二/三维图上绘制黑点
Common methods of string: construction method, other methods
Enterprise private network construction and operation and maintenance
Now developers are beginning to do testing. Will there be no software testers in the future?
Burp Suite-第六章 如何使用Burp Spider
Solution to the problem of token loss when microservice feign is called
NFS service and Samba service deployment
Polymorphism, final and interface
一文掌握mysql数据库审计特点、实现方案及审计插件部署教程
Learning Efficient Convolutional Networks Through Network Slimming
JWT quick start
Use of views
[xshell7 free download and installation]
OVSDB
FTP service
Summary of distributed related interview questions
Strtus2历史漏洞复现