xsd:include和xsd:import之间有什么区别?什么时候你会用一种而不是另一种,什么时候它可能无关紧要?


当前回答

include和import之间的基本区别在于,必须使用import引用位于不同目标名称空间中的声明或定义,而必须使用include引用位于(或将位于)同一目标名称空间中的声明或定义。

来源:https://web.archive.org/web/20070804031046/http: / / xsd.stylusstudio.com/2002Jun/post08016.htm

其他回答

直接引用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.

include和import之间的基本区别在于,必须使用import引用位于不同目标名称空间中的声明或定义,而必须使用include引用位于(或将位于)同一目标名称空间中的声明或定义。

来源:https://web.archive.org/web/20070804031046/http: / / xsd.stylusstudio.com/2002Jun/post08016.htm

使用xsd:include将外部模式文档的所有声明和定义带入当前模式。

使用xsd:import从不同的名称空间引入一个xsd,用于通过扩展现有模式文档来构建一个新模式。

使用xsd:include引入来自相同或不存在命名空间的xsd。

使用xsd:import从不同的名称空间引入xsd。

我对这个也很感兴趣。我找到的唯一解释是,xsd:include用于名称空间内的包含,而xsd:import用于名称空间间的包含。