当前位置:网站首页>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”);


边栏推荐
- 微服务feign调用时候,token丢失问题解决方案
- 如何关闭高位端口
- NFS service and Samba service deployment
- Meta universe infrastructure: analysis of the advantages of Web 3.0 chain33
- 2022-07-08 group 5 Gu Xiangquan's learning notes day01
- Burp Suite-第八章 如何使用Burp Intruder
- JMeter performance test saves the results of each interface request to a file
- 2022-07-13 group 5 Gu Xiangquan's learning notes day06
- The difference between overloading and rewriting
- [fastjson1.2.24 deserialization vulnerability principle code analysis]
猜你喜欢

2022-07-08 group 5 Gu Xiangquan's learning notes day01

From boosting to lamdamart

Web page basic label

Matlab-二/三维图上绘制黑点

Audio and video learning (10) -- PS streaming

IDEA settings设置快捷键实现字符串中的英文字母转大小写

Pycharm code specification tool flake8

JSP implicit object servlet object

2022-07-13 group 5 Gu Xiangquan's learning notes day06

Logical volume management (LVM)
随机推荐
Quantitative perception training in tensorflow2.x and x86 end evaluation of tflite
Abnormal (2)
Establishment and use of openstack cloud platform
Web side 3D visualization engine hoops communicator reads 10g super large model test | digital twin Technology
Jmeter性能测试之使用存储响应内容到文件监听器
Copy pcap file with producer consumer model
Dynamic performance view overview
JSP action -- usebean action
NFS service and Samba service deployment
Burp Suite-第八章 如何使用Burp Intruder
Now developers are beginning to do testing. Will there be no software testers in the future?
Summary of traversal methods of list, set, map, queue, deque and stack
Using producer consumer model and dpkt to process pcap files
QT listview add controls and pictures
小组成员参加2022中国多媒体大会
Sort: merge sort and quick sort
JSP implicit object -- scope
[keras entry log (3)] sequential model and functional model in keras
If the thread crashes, why doesn't it cause the JVM to crash? What about the main thread?
PyTorch