2 XML schema
来源:互联网 发布:树莓派的编程语言 编辑:程序博客网 时间:2024/06/04 19:40
以spring配置为例子:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd " default-autowire="byName"> </beans>
一 <?xml version="1.0" encoding="UTF-8"?> 这是xml本身的声明,表示这是一个xml文档
二 beans:xml的一个元素,你也可以叫做sb lowb(随便你怎么叫)
三 xmlns="http://www.springframework.org/schema/beans" :表示beans元素的默认命名空间,本质上所有的元素都应该长成这个样子:<bean:xxx> <tx:xxx> <aop:xxx> ,现在你写成了<bean>,那就表示是默认的命名空间里面的元素名称 。
xmlns的作用:就是给一组元素名称一个统一的名称,用于区别其他的名称。
四 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" :这个一个叫做xsi的命名空间,但是这个命名空间是一个标准,使用xsi的属性schemaLocation来给命名空间赋值,这个值就是xsd文件的位置
五 xis:schemaLocation:由一个或多个URI引用对组成,第一个uri是前面定义的url,第二个uri是uri对应的xsd文档的位置。两个url之间以空格或者换行隔开
六 default-autowire是默认命名空间的属性值,也就是http://www.springframework.org/schema/beans这个里面的属性
七 第四条纯属个人理解,我觉得xsi:schemaLocation就是起到了一个赋值的作用。(如果有更好的标准解释,求告知)
阅读全文
0 0
- 2 XML schema
- Xml Schema 整理笔记(2)
- XML Schema帮助文档2
- 使用W3C XML Schema(2)
- XML schema 2 复合元素
- XML总结(2)-Schema技术
- XML Schema
- XML Schema
- XML Schema
- xml schema
- XML Schema
- XML Schema
- xml schema
- XML SCHEMA
- Xml Schema
- Xml Schema
- XML Schema
- Xml Schema
- uget使用aria2,出现Is aria2 shutdown的错误
- 问题 C: 二哈大定理
- 【风宇冲】Unity3D教程宝典之Shader篇:第四讲制作一个美丽的地球 + 云层颜色的一点见解
- 【populating-next-right-pointers-in-each-node-ii】
- 170907_学习测试(三)_Apache JMeter 入门(二)_JMeter脚本录制
- 2 XML schema
- 函数
- 《C++ Primer》读书笔记第四章-1-基础 And 运算符
- 三大框架之Spring (初级学习 2)
- springMVC整合freemarker的使用
- ajax使用serialize()方法后,数据无法封装并获取(PUT提交方式!)
- Android源码:AMS、PMS、WMS原理分析
- Ubuntu修改hosts地址
- 一些关于链表的题