Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between xsd:include and xsd:import?

Tags:

xml

xsd

What's the difference between xsd:include and xsd:import? When would you use one instead of the other, and when might it not matter?

like image 564
Pops Avatar asked Mar 01 '10 18:03

Pops


People also ask

What is the use of import element in XSD?

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.

What is schema import?

Definition and Usage The import element is used to add multiple schemas with different target namespace to a document.

What is the difference between XML Schema and XSD?

Differences: XSD is based and written on XML. XSD defines elements and structures that can appear in the document, while XML does not. XSD ensures that the data is properly interpreted, while XML does not.


2 Answers

The fundamental difference between include and import is that you must use import to refer to declarations or definitions that are in a different target namespace and you must use include to refer to declarations or definitions that are (or will be) in the same target namespace.

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

like image 123
Sergiy Belozorov Avatar answered Nov 04 '22 00:11

Sergiy Belozorov


Use xsd:include to bring in an XSD from the same or no namespace.

Use xsd:import to bring in an XSD from a different namespace.

like image 31
kjhughes Avatar answered Nov 04 '22 00:11

kjhughes