当前位置:网站首页>Basic learning of XML
Basic learning of XML
2022-08-10 14:54:00 【ythswzgxlp】
1.xml concept:
(1) Concept: XML (Extensible Markup Language: Extensible Markup Language) Extensible Markup Language
(2) Function: Store data--method: 1. Configuration file; 2. Transmission in the network.
(3) The difference between xml and html:
1.xml tags are all custom, html tags are predefined.
2.xml has strict syntax and html syntax is loose.
3.xml is for storing data, and html is for displaying data.
2. Syntax:
(1) Notes on xml creation:
1.xml file extension: .xml.
The first line of 2.xml must be defined as the document description.
There is only one root tag in the3.xml document.
4. The attribute value must be enclosed in quotation marks (single and double).
5. Tags must be properly closed: with a head and tail, except for self-closing tags.
6.xml tag name.
Example:
(2) Notes on custom tags:
1. The name can contain letters, numbers and other characters.
2. The name cannot start with a number or punctuation.
3. The name cannot start with the letters xml (or Xml, XML, etc.).
4. The name cannot contain spaces.
3. Constraints:
What is a constraint: specifies the writing rules of an xml document.
As a user (programmer) of the framework: 1. Be able to introduce constraint documents in xml; 2. Be able to simply read and understand constraint documents.
Categories:
1.DTD: a simple constraint technique, replaced;
2.Schema: A complex constraint technique.
4. Parsing XML
(1) Concept: operate the xml document and read the data in the document into the memory
Operating documents: 1. Parsing (reading): Read the data in the document into the memory; 2. Write: Save the data in the memory to the xml document for persistent storage.
How to parse xml:
1.DOM: Load the markup language document into the memory at one time, and form a dom tree in the memory (used on the server side):
Advantages: easy to operate, can perform all CRUD operations on the document
Disadvantage: takes up memory
2.SAX: read line by line, event-driven (mobile terminal use):
Advantages: no memory usage
Disadvantages: only read, can not add, delete or modify
(2) Common parsers for xml:
1.JAXP: The parser improved by sun company supports two ideas of dom and sax, but the performance is low and basically useless.
2.DOM4J: A very good parser, based on DOM.
3.3.Jsoup: Jsoup is a Java HTML parser that can directly parse a URL address and HTML text content.It enhances a very labor-saving API for fetching and manipulating data through DOM, CSS, and jQuery-like manipulation methods.
4.PULL: The built-in parser of the Android operating system, based on the sax method.
边栏推荐
- 从全球价值链视角看,京东云数智供应链对未来经济有何影响?
- Using data intelligence, Amazon cloud technology helps companies build endogenous brand growth
- 小程序-语音播报功能
- mysql进阶(三十三)MySQL数据表添加字段
- 产品使用说明书小程序开发制作说明
- 1004 (tree array + offline operation + discretization)
- Boss raises salary!Look at my WPF Loading!!!
- 网络安全(加密技术、数字签名、证书)
- Steam教育在新时代中综合学习论
- 池化技术有多牛?来,告诉你阿里的Druid为啥如此牛逼!
猜你喜欢
基于 Azuki 系列:NFT估值分析框架“DRIC”
缺少比较器,运放来救场!(运放当做比较器电路记录)
fatal error C1083 Unable to open include file 'io.h' No such file
等保2.0一个中心三重防护指的是什么?如何理解?
易观分析联合中小银行联盟发布海南数字经济指数,敬请期待!
领域驱动模型设计与微服务架构落地-从项目去剖析领域驱动
MySQL 原理与优化:Update 优化
Appium进行APP自动化测试
Alibaba的秒杀系统—千亿级并发设计手册上线了
1W word detailed thread local storage ThreadLocal
随机推荐
解题-->在线OJ(十九)
awk的简单使用
老板加薪!看我做的WPF Loading!!!
[Gazebo Introductory Tutorial] Lecture 3 Static/Dynamic Programming Modeling of SDF Files
win2012安装Oraclerac失败
第五讲 测试技术与用例设计
PyTorch 多机多卡训练:DDP 实战与技巧
How does IT Xiaobai learn PHP systematically
容器化 | 在 S3 实现定时备份
Appium进行APP自动化测试
pytest框架优化
使用mysq语句操作数据库
波士顿房价预测
2022年中国软饮料市场洞察
《论文阅读》PLATO: Pre-trained Dialogue Generation Model with Discrete Latent Variable
sql语句 异常 Err] 1064 – You have an error in your SQL syntax; check the manual that corresponds to your
正则表达式(包含各种括号,echo,正则三剑客以及各种正则工具)
antd组件中a-modal设置固定高度,内容滚动显示
线上线下课程教学培训小程序开发制作功能介绍
MQTT服务器搭建