zoukankan      html  css  js  c++  java
  • spring xml头文件xmlns和xsi的意思

    http://blog.csdn.net/myherux/article/details/50967342

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:mvc="http://www.springframework.org/schema/mvc" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-4.1.xsd 
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-4.1.xsd 
            http://www.springframework.org/schema/mvc 
            http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">

    1.beans —— xml文件的根节点 

    2.xmlns ——类似于java中的package,是XML NameSpace的缩写,因为XML文件的标签名称都是自定义的,自己写的和其他人定义的标签很有可能会重复命名,而功能却不一样,所以需要加上一个namespace来区分这个xml文件和其他的xml文件,。 

    3.xmlns:xsi ——是指xml文件遵守xml规范,xsi全名:xml schema instance,是指具体用到的schema资源文件里定义的元素所准守的规范。即http://www.w3.org/2001/XMLSchema-instance这个文件里定义的元素遵守什么标准 
    4.xsi:schemaLocation——是指本文档里的xml元素所遵守的规范,这些规范都是由官方制定的,可以进你写的网址里面看版本的变动。xsd的网址还可以帮助你判断使用的代码是否合法。 
    所以如下代码:

  • 相关阅读:
    sping AOP核心思想及实现原理
    springmvc RequestMappingHandlerMapping初始化详解
    springmvc RequestMappingHandlerAdapter初始化详解
    POJ 3169 Layout
    POJ 3264
    POJ 3461 Oulipo
    二分图判定 POJ-2492
    最小生成树 prim算法
    初级BFS
    哈夫曼建树
  • 原文地址:https://www.cnblogs.com/newlangwen/p/6729711.html
Copyright © 2011-2022 走看看