Knowledge.ToString()

http://www.w3.org/XML/1998/namespace issue while importing XSD

If you are trying to work with XSD you may encounter following errors

  • Namespace ‘http://www.w3.org/XML/1998/namespace’ is not available to be referenced in this schema.
  • Imported schema for namespace ‘http://www.w3.org/XML/1998/namespace’ was not resolved.

This error means that either you need to declare the namespace “http://www.w3.org/XML/1998/namespace” within XSD or the xml.xsd file in which this namespace is declared is not available.

If you need to declare the namespace, add the following line within xsd as a first child within <xsd:schema> tag

<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" />

Also the folder in which you have your xsd file, you need to have “xml.xsd” file available. This file is a generic file regardless of the structure of your xml data.

Download xml.xsd file

This download contains zip file. Extract xml.xsd out of it and place it in the same directory which has your own xsd file.

Note: xml.xsd from zip is exactly same as what is available at https://www.w3.org/2001/03/xml.xsd. This download is available for added convenience just in case you forget to copy source code of this xsd and instead if you copy what is visible on the browser.

Share

Comments

One response to “http://www.w3.org/XML/1998/namespace issue while importing XSD”

  1. Generate Sample XML Data From XSD Using Visual Studio | Vishal Monpara

    […] If you face difficulty generating the sample XML data and encounter error regarding namespace, resolve xsd namespace error by following these steps. […]

Leave a Reply

Your email address will not be published. Required fields are marked *