Where is the XSD file for “http://www.w3.org/2001/XMLSchema-instance”

xsd

Where is the XSD schema definition file for the namespace "http://www.w3.org/2001/XMLSchema-instance"?

Best Answer

Strange it may sound, but the XML schema for http://www.w3.org/2001/XMLSchema-instance namespace does exist and is found exactly by the very URL denoted by the namespace URI: http://www.w3.org/2001/XMLSchema-instance

For a proof, just open that link (URL) in an HTML browser (e.g. FireFox). You will probably see some HTML text, like: "XML Schema instance namespace ...". Then, save that 'HTML' as a file on your computer (e.g. File | Save Page As). When you look into this file, you will see that it is not HTML at all. Rather, it is a complete XML schema for that namespace!

Equally, you can import the http://www.w3.org/2001/XMLSchema-instance namespace into your own schema as the following:

<xs:import namespace="http://www.w3.org/2001/XMLSchema-instance"
           schemaLocation="http://www.w3.org/2001/XMLSchema-instance"/>

See also this question: Error while parsing xsd using xjc, which although sounds very differently, actually very much related to the same problem.

Related Topic