指定默认命名空间

name 可以忽略不填,即为默认命名空间,如:

xmlns="http://www.springframework.org/schema/beans" 表现效果则为命名空间中的元素可以不加前辍,在此 xml 中直接使用,如上面的

<bean id="bean" class="com.feshfans.Bean"></bean>   // bean 元素可以直接使用

指定自定义命名空间

  • xmlns:命名空间,引入其他命名空间
  • 使用该命名空间的元素需要加上命名空间作为前缀

详细教程

xmlns, xmlns:xsi, xsi:schemaLocation 解释 - feshfans - 博客园