xml xmlns xmlns:xsi xsi:schemaLocation含义

来源:互联网 发布:故宫神思知乎 编辑:程序博客网 时间:2024/05/16 09:18

以下为浅显的理解

xmlns表示命名空间

xmlns="http://www.springframework.org/schema/beans" 表示默认命名空间

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 这个命名空间里面的元素或者属性就必须要以xsi:这种方式来写
比如schemaLocation就是他的一个属性,所以写成xsi:schemaLocation。而默认命名空间不带类似xsi这种。

xsi:schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
表示把定义这个命名空间的schema文件给引用进来,好让eclipse这类型工具能够解析和验证你的xml文件是否符合语法规范

以上认识不足,还望指教


阅读全文
1 0
原创粉丝点击