xsd:include和xsd:import之间有什么区别?什么时候你会用一种而不是另一种,什么时候它可能无关紧要?
当前回答
直接引用MSDN: <xsd:import> Element,备注section
The difference between the include element and the import element is that import element allows references to schema components from schema documents with different target namespaces and the include element adds the schema components from other schema documents that have the same target namespace (or no specified target namespace) to the containing schema. In short, the import element allows you to use schema components from any schema; the include element allows you to add all the components of an included schema to the containing schema.
其他回答
我对这个也很感兴趣。我找到的唯一解释是,xsd:include用于名称空间内的包含,而xsd:import用于名称空间间的包含。
使用xsd:include引入来自相同或不存在命名空间的xsd。
使用xsd:import从不同的名称空间引入xsd。
include和import之间的基本区别在于,必须使用import引用位于不同目标名称空间中的声明或定义,而必须使用include引用位于(或将位于)同一目标名称空间中的声明或定义。
来源:https://web.archive.org/web/20070804031046/http: / / xsd.stylusstudio.com/2002Jun/post08016.htm
使用xsd:include将外部模式文档的所有声明和定义带入当前模式。
使用xsd:import从不同的名称空间引入一个xsd,用于通过扩展现有模式文档来构建一个新模式。
直接引用MSDN: <xsd:import> Element,备注section
The difference between the include element and the import element is that import element allows references to schema components from schema documents with different target namespaces and the include element adds the schema components from other schema documents that have the same target namespace (or no specified target namespace) to the containing schema. In short, the import element allows you to use schema components from any schema; the include element allows you to add all the components of an included schema to the containing schema.
推荐文章
- XSD和WSDL之间的区别是什么?
- 如何将XML转换成PHP数组?
- XMLHttpRequest Origin null不允许Access-Control-Allow-Origin for file:/// to file:///(无服务器)
- LINQ读取XML
- 如何设置RecyclerView应用程序:layoutManager=""从XML?
- JavaScript中变量字符串的XML解析
- 具有多个条件的XPath
- 格式化XML字符串以打印友好的XML字符串
- malformedurlexception:没有协议
- 选择包含“foo”的属性的正确XPath是什么?
- 字符串资源新行/n不可能?
- Android: ScrollView vs NestedScrollView
- 如何把空格字符放入XML字符串名?
- 比较Java中2个XML文档的最佳方法
- 将XML字符串转换为对象