XML Schema 中 import 和 include 的区别
XML Schema 允许将一个XSD文件分为几个文件存放,在必要时使用 import 或者 include 进行导入。这二者的区别是:
- import:只能导入不同命名空间的XSD
- include:只能导入相同命名空间的XSD,或被导入的XSD未声明命名空间
例子:
<xsd:import namespace=”http://acme.com/supplier/types”
schemaLocation=”http://acme.com/supplier/types.xsd”/>
<xsd:include schemaLocation=”http://acme.com/supplier/types.xsd”/>
By javafuns on July 22, 2008 at 13:24 ·
Views: 1,625 · Permalink · RSS
Categorized in: SOA · Tagged with: XML
Categorized in: SOA · Tagged with: XML


(
on 2010/02/07 at 21:12
· Permalink
这里应该存在点误解,import也可以用来引入相同namespace的schema
on 2010/02/08 at 22:41
· Permalink
不可以,相同的namespace只能用include导入
on 2010/02/08 at 22:43
· Permalink
我特意重新查找了一下,ORACLE网站上有一篇文章介绍的比较详细:
http://www.oracle.com/technology/pub/articles/srivastava_structures.html