Hosting W3 XML Schema files locally

后端 未结 1 1942
一生所求
一生所求 2020-12-02 02:01

I work at a company where we have our own XML language with its own set of schemas that validate against the W3 schema. For business reasons, I need to host these files inte

相关标签:
1条回答
  • 2020-12-02 02:39

    To host external XSDs, including any from W3C, locally:

    1. Identify external XSD dependencies.

      You can identify an XSD's external dependencies through the transitive closure of all XSD's given by xs:include and xs:import @schemaLocation attributes. (No xs:include or xs:import implies no dependencies.)

    2. 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.

    3. 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.

    0 讨论(0)
提交回复
热议问题