当前位置:网站首页>配置xml文件的dtd
配置xml文件的dtd
2022-07-03 05:18:00 【奈良森屿】
目录
2.XML标签区分大小写,例如下图中的“filter”和“Filter”、“listener”和“Listener”就不是同一个东西,所以不同
4.正确嵌套标签,图中config中嵌套了action,action中嵌套了forward
5.使用了合法的标签名,图中的action和forward就是标签名
1.了解dtd的思维导图
2.XML是什么?
- XML 指可扩展标记语言(EXtensible Markup Language)
- XML 是一种标记语言,类似 HTML
- XML 的设计宗旨是传输数据,而非显示数据
- XML 标签没有被预定义。您需要自行定义标签。
- XML 被设计为具有自我描述性。
- XML 是 W3C 的推荐标准
3.XML的作用:
不只是做配置,还有对于跨语言的数据交互
4.为什么学习XML
在XML语言中,它允许用户自定义标签。一个标签用于描述一段数据;一个标签可以分为开始标签和结束标签,在开始标签和结束标签之间,又可以使用其他标签描述其他数据,以此来实现数据关系的描述。
5.标准的XML的格式:
1.有且只有一个根元素,途中的<!DOCTYPE root[]>
2.XML标签区分大小写,例如下图中的“filter”和“Filter”、“listener”和“Listener”就不是同一个东西,所以不同
3.正确使用结束标签,图中的<config></config>有开始,既有结束。举个例子:类似于HTML双标签
4.正确嵌套标签,图中config中嵌套了action,action中嵌套了forward
5.使用了合法的标签名,图中的action和forward就是标签名,path和type这种就是属性
6.定义有效的属性
6.两个例子:
上图中的root就是config
element-name就是嵌套关系,
就比如config是dtd的头,config中有两个aciton,action中有两个forward
<?xml version="1.0" encoding="UTF-8"?> <!-- config标签:可以包含0~N个action标签 --> <!DOCTYPE config[ <!ELEMENT config (action*)> <!ELEMENT ation (forward*)> <!ATTLIST action path CDATA #REQUIRED type CDATA #REQUIRED > <!ATTLIST forward name CDATA #REQUIRED path CDATA #REQUIRED redirect (true|false) 'true' > ]> <config> <!-- action标签:可以饱含0~N个forward标签 path:以/开头的字符串,并且值必须唯一 非空 ,子控制器对应的路径 type:字符串,非空,子控制器的完整类名 --> <action path="/registerAction" type="test.action.RegisterAction"> <forward name="success" path="/index.jsp" redirect="true" /> <forward name="failed" path="/register.jsp" redirect="false" /> </action> <action path="/loginAction" type="test.action.LoginAction"> <forward name="a" path="/index.jsp" redirect="false" /> <forward name="b" path="/welcome.jsp" redirect="true" /> </action> </config>
<?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 br EMPTY> <!ATTLIST person pid ID #REQUIRED sex (男|女) '男' qq CDATA #IMPLIED parent IDREF #IMPLIED > ]> <persons> <person pid="p1" sex="男" qq="aaa" parent="p2"> <name>张小明</name> <age>10</age> <contact> <phone>1234567</phone> </contact> <br/> </person> <person pid="p2"> <name>张大明</name> <age>35</age> <contact> <email>[email protected]</email> </contact> </person> </persons>
边栏推荐
- (完美解决)matplotlib图例(legend)如何自由设置其位置
- Appium 1.22. L'Inspecteur appium après la version X doit être installé séparément
- Go practice -- gorilla / websocket used by gorilla web Toolkit
- 请求数据库报错:“could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGram
- 112 stucked keyboard (20 points)
- leetcode860. Lemonade change
- 1119 pre- and post order traversals (30 points)
- 1106 lowest price in supply chain (25 points)
- 1114 family property (25 points)
- (subplots用法)matplotlib如何绘制多个子图(轴域)
猜你喜欢
XML Configuration File
leetcode435. Non overlapping interval
About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
Principles of BTC cryptography
Technical analysis of qianyuantong multi card aggregation router
Classification and discussion of plane grab detection methods based on learning
Go practice -- gorilla / websocket used by gorilla web Toolkit
Pessimistic lock and optimistic lock of multithreading
Promise
Go practice - gorilla / handlers used by gorilla web Toolkit
随机推荐
Principles of BTC cryptography
Go practice -- use JWT (JSON web token) in golang
Interview question -- output the same characters in two character arrays
[practical project] autonomous web server
Webrtc protocol introduction -- an article to understand ice, stun, NAT, turn
2022-02-12 daily clock in: problem fine brush
Web APIs exclusivity
JQ style, element operation, effect, filtering method and transformation, event object
Go language interface learning notes
Webapidom get page elements
酒店公共广播背景音乐-基于互联网+的酒店IP网络广播系统设计
Burp suite plug-in based on actual combat uses tips
Training method of grasping angle in grasping detection
大学校园IP网络广播-厂家基于校园局域网的大学校园IP广播方案设计指南
Yolov5 input (I) -- mosaic data enhancement | CSDN creative punch in
[batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)
Dynamic programming - related concepts, (tower problem)
About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
(subplots usage) Matplotlib how to draw multiple subgraphs (axis field)
[Yu Yue education] basic reference materials of interchangeability and measurement technology of Zhongyuan Institute of Technology