先上一段xml文档

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:batch="http://www.springframework.org/schema/batch"
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.xsd
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
">
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"></bean>
<bean id="transactionManager"
class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<batch:job id="iconvJob">
<batch:step id="iconvStep">
<batch:tasklet transaction-manager="transactionManager">
<batch:chunk reader="iconvItemReader" writer="iconvItemWriter"
processor="iconvItemProcessor" commit-interval="1" />
</batch:tasklet>
</batch:step>
</batch:job>
<context:property-placeholder location="classpath:files.properties" />
<bean id="iconvItemReader" class="com.inetpsa.batch.iconv.IconvItemReader">
<property name="input" value="file:${input.file}" />
<property name="charset" value="UTF-8" />
</bean>
<bean id="iconvItemWriter" class="com.inetpsa.batch.iconv.IconvItemWriter">
<property name="output" value="file:${output.file}" />
<property name="charset" value="UTF-8" />
</bean>
<bean id="iconvItemProcessor" class="com.inetpsa.batch.iconv.IconvItemProcessor" />
</beans>

从头开始解释:

1.xmlns

xmlns="http://www.springframework.org/schema/beans"

指定了该xml的默认的namespace是:xmlns="http://www.springframework.org/schema/beans",对,这是一个URI,(至于URI和URL的区别,引用知乎上的一句话解释:URI 和 URL 都定义了 what the resource is。URL 还定义了 how to get the resource。),这个URI在后面的 xsi:schemaLocation 中需要用到,来引入该namespace对应的schema的URL:

xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
">

其中红色的两部分用空格分隔,前面是该namespace的值,该值和前面用xmlns定义的是一致的,后半部分定义了该namespace对应的schema的地址,可以用浏览器打开看一下,就是一个schema文档,这个文档其实就是Spring XML Beans Schema。所以本文一开始的xml立案,<bean>标签不需要加什么前缀。

2.xmls:xsi

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="略"

主要是上面这个地方用到了xsi,到底是什么意思呢,其实该前缀的名称也是可以变的,比如改成xsii也可以,只不过一定该属性的值是http://www.w3.org/2001/XMLSchema-instance

---

xml schema xmlns xmlns:xsi xsi:schemaLocation targetnamespace的更多相关文章

  1. XML Schema

    XML Schema 是基于 XML 的 DTD 替代者. XML Schema 描述 XML 文档的结构. XML Schema 语言也称作 XMLSchema 定义(XML Schema Defi ...

  2. xmlns:xsi ——是指xml文件遵守xml规范,xsi全名:xml schema instance

    http://blog.sina.com.cn/s/blog_4b6f8d150100nx3e.html http://blog.csdn.net/iaiti/article/details/4226 ...

  3. hibernate 注解配置<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/X

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  4. spring xml头文件xmlns和xsi的意思

    在spring的配置中,总能看见如下的代码: <beans xmlns="http://www.springframework.org/schema/beans" xmlns ...

  5. xmlns, xmlns:xsi, xsi:schemaLocation 解释

    xmlns, xmlns:xsi, xsi:schemaLocation 解释 xmlnsxsischemaLocation 我们在写 xml 文件时,尤其是 spring .mybatis 的配置文 ...

  6. xml文件中 xmlns xmlns:xsi 等解释

    http://bbs.csdn.NET/topics/390751819 maven 的 pom.xml 开头是下面这样的 <project xmlns="http://maven.a ...

  7. XML 中的 xmlns 等属性的意义

    原文:https://blog.csdn.net/lengxiao1993/article/details/77914155 Maven 是一个 java 开发人员很难绕过的构建工具, 因为有众多的开 ...

  8. 有关xml中的xmlns

    1. xmlns "xmlns"是XHTML namespace的缩写,叫做"名字空间"声明.名字空间是什么作用呢?我的理解是:由于xml允许你自己定义自己的标 ...

  9. XML Schema命名空间解析

    URI Web中汇集了各种资源.资源可以是具有标识的任何事物, 如文档. 文件. 菜单项. 计算机. 服务等, 甚至可以包括人. 组织和概念[BernersLee 1998].在Web体系结构中, ...

随机推荐

  1. 红米3 Flyme5.1.9.5插桩适配长期不定时更新

    ROM介绍: 2016.9.5更新日志: 1,更新源码到0905 2.修复bug若干. 2016.8.29更新日志: 1,更新源码到0829 2.修复bug若干. 2016.8.22更新日志: 1,更 ...

  2. Ubuntu 14.04 无线网卡驱动安装

    安装了Ubuntu最新版本 14.04 之后,发现无线网卡不能使用,偿试安装驱动后,问题解决. 首先确定无线网卡类型: lspci -vnn -d 14e4: 比如我的网卡类型为 06:00.0 Ne ...

  3. excel出现错误1327 无效的驱动器

    错误描述:错误1327 无效的驱动器 错误程序:excel 2003   这是office安装源的位置被移动造 成的的,大部分时候安装时可能使用了移动硬盘或者在安装后调整了盘符就会造成这个问题.官方的 ...

  4. ARM学习 之 如何在向内核写入系统调用

    本文主要介绍两个例子:1-系统调用打印“hello kernel”  2-驱动开发板的蜂鸣器 使用的是友善之臂(Friendly ARM)的开发板,三星2440 =================== ...

  5. 【BZOJ-3195】奇怪的道路 状压DP (好题!)

    3195: [Jxoi2012]奇怪的道路 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 305  Solved: 184[Submit][Statu ...

  6. 七牛图片上传JSSDK

    BASE64图片上传 接口说明: POST /putb64/<Fsize>/key/<EncodedKey>/mimeType/<EncodedMimeType>/ ...

  7. 没有为 COM 互操作注册程序集 请使用 regasm.exe /tlb 注册该程序集——解决办法

    错误现象: 错误 6 没有为 COM 互操作注册程序集“DevExpress.Utils.v13.1, Version=13.1.7.0, Culture=neutral, PublicKeyToke ...

  8. 计数器(counter),有序字典(OrderDict),默认字典(defaultdict),可命名元祖(namedtuple),双向队列(deque),单项队列(deuqe.Queue)

    Python_Day_05 计数器(counter),有序字典(OrderDict),默认字典(defaultdict),可命名元祖(namedtuple),双向队列(deque),单项队列(deuq ...

  9. JQuery事件之鼠标事件

    鼠标事件是在用户移动鼠标光标或者使用任意鼠标键点击时触发的. ():click事件:click事件于用户在元素敲击鼠标左键,并在相同元素上松开左键时触发. $('p').click(function( ...

  10. 关于学习JavaScript 的 高三编程 一些心得

    面对JS 问题来说,很多的细节问题以及 弱类型转换的问题,往往会成为学习js 路上的一个阻碍. 那么问题来了,今天我看到的是  高三 里面的  基本概念的 语法问题. 直奔主题.(还是帖代码先) sw ...