Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xsd

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

like image 305
Mark Leighton Fisher Avatar asked Jun 13 '13 18:06

Mark Leighton Fisher


People also ask

Where is the XSD file located?

SchemaViewer is a free program that will display XSD files in the proper tree format, which makes them easier to read than with a simple text editor like Notepad. The file can also open with Microsoft Visual Studio, XML Notepad, EditiX XML Editor, Progress Stylus Studio, and XMLSpy.

How do I get an XSD file?

With the desired XML document opened in the active editor tab, choose Tools | XML Actions | Generate XSD Schema from XML File on the main menu. The Generate Schema From Instance Document dialog box opens. and select the desired file in the dialog that opens.

What is XSD schema file?

An XML schema definition (XSD), is a framework document that defines the rules and constraints for XML documents. An XSD formally describes the elements in an XML document and can be used to validate the contents of the XML document to make sure that it adheres to the rules of the XSD.

What is xmlns XSI http www w3.org 2001 XML schema instance?

xmlns:xsi:http://www.w3.org/2001/XMLSchema-instance — Declared in the XML and is used to help declare that the XML document is an instance of and XSD. The convention is to use the namespace prefix of xsi. targetNamespace: is used in the header of the XSD to defined the namespace that the XSD describes.


2 Answers

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.

like image 169
ColdFusion Avatar answered Sep 24 '22 13:09

ColdFusion


Just to add fuel to the fire -- many XML tools have knowledge of http://www.w3.org/2001/XMLSchema-instance baked-in, so it looks like you never need the schema at all. In fact, you need the schema if you are using an XML tool that does not bake-in this knowledge.

like image 37
Mark Leighton Fisher Avatar answered Sep 25 '22 13:09

Mark Leighton Fisher