Consider following two examples:
Example 1:
<xs:import namespace="http://example.com/ns" schemaLocation="test.xsd"/>
Example2:
<sample:Data Test="true" xsi:schemaLocation="http://example.com/test.xsd">
How these two examples are different? What is purpose of namespace ? Is it a required field, as I can not see in second example. (What kind of document should be available in the URL defined by the namespace? eg. some xml file or xsd file etc?)
Also, in first example there is schemaLocation while in second there is xsi:schemaLocation, what is diffence between these two? Also, what does the Test=true in second example mean?
Thanks.
The xs:import element is used in an XML schema to import definitions from another schema with a different target namespace. This is why you must specify that namespace. The xsi:schemaLocation attribute is used in an XML document to indicate which schema defines the syntax for the XML document.
xsi:schemaLocation is not necessarily used by whatever processes the XML document.