在本地托管 W3 XML Schema 文件 [英] Hosting W3 XML Schema files locally

查看:36
本文介绍了在本地托管 W3 XML Schema 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一家拥有自己的 XML 语言的公司工作,该语言具有自己的一组架构,可以根据 W3 架构.出于商业原因,我需要在内部托管这些文件,而不是依赖网络托管版本.我对 XML 模式几乎没有经验,我想知道这到底意味着什么.是否像将页面源复制并粘贴到我自己的文件中并将我们的其他模式指向那里一样简单?我还需要担心命名空间文件吗?任何帮助在这里表示赞赏.谢谢.

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 internally instead of relying on the web hosted versions. I have little experience with XML schemas and am wondering what exactly this means. Is it as simple as copying and pasting the page source into my own file and pointing our other schemas there? Do I need to worry about the namespace documents as well? Any help here is appreciated. Thanks.

推荐答案

在本地托管外部 XSD,包括来自 W3C 的任何 XSD:

  1. 识别外部 XSD 依赖项.

您可以通过 xs:includexs:import @schemaLocation 属性给出的所有 XSD 的传递闭包来识别 XSD 的外部依赖项.(没有 xs:includexs:import 意味着没有依赖关系.)

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

在本地复制 XSD.

请注意,要实际检索 xml.xsd,使用浏览器以外的工具(例如wget)或查看文件源投放到您的网络浏览器.

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.

调整对 XSD 的引用.

更新 @schemaLocation 属性以引用本地而不是远程副本.看如何正确引用本地 XML Schema 文件?或者,使用 XML 目录 重新映射到本地位置.

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.

请注意,您不需要更改任何 命名空间 URI,它们是不需要可检索的词法结构.

Note that you do not need to change any namespace URIs, which are lexical constructs that do not need to be retrievable.

这篇关于在本地托管 W3 XML Schema 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆