Hosting W3 XML Schema files locally
Solution 1:
To host external XSDs, including any from W3C, locally:
-
Identify external XSD dependencies.
You can identify an XSD's external dependencies through the transitive closure of all XSD's given by
xs:include
andxs:import
@schemaLocation
attributes. (Noxs:include
orxs:import
implies no dependencies.) -
Copy the XSDs locally.
Note that to actually retrieve xml.xsd, use a tool other than a browser (e.g. wget) or view the source of the file served to your web browser.
-
Adjust references to the XSDs.
Update the
@schemaLocation
attributes to reference the local rather than the remote copy. See How to reference a local XML Schema file correctly? Or, use an XML Catalog to remap to a local location.
Note that you do not need to change any namespace URIs, which are lexical constructs that do not need to be retrievable.