Can I have one XML Schema (XSD) include another XML-Schema? Can I have one XML Schema (XSD) include another XML-Schema? xml xml

Can I have one XML Schema (XSD) include another XML-Schema?


There are two methods for this.

<xsd:include schemaLocation="pathToFile" /> should be used for including files of the same namespace.

<xsd:import namespace="namespace" schemaLocation="pathToFile" /> should be used for include files in a different namespace. Usually you will specify the namespace given as the targetNamespace of the imported schema.


Use the <include> element, see for example here.