“http://www.w3.org/2001/XMLSchema-instance"的 XSD 文件在哪里? [英] Where is the XSD file for "http://www.w3.org/2001/XMLSchema-instance"?
问题描述
命名空间http://www.w3.org/2001/XMLSchema-的XSD架构定义文件在哪里?实例"?
推荐答案
这听起来很奇怪,但是 http://www.w3.org/2001/XMLSchema-instance
命名空间的 XML 模式确实存在,并且可以通过命名空间 URI 表示的 URL 准确找到:http://www.w3.org/2001/XMLSchema-instance
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
作为证明,只需在 HTML 浏览器(例如 FireFox)中打开该链接 (URL).您可能会看到一些 HTML 文本,例如:XML Schema instance namespace ...".然后,将该HTML"另存为计算机上的文件(例如文件 | 另存页面为).当您查看此文件时,您会发现它根本不是 HTML.相反,它是该命名空间的完整 XML 模式!
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!
同样,您可以将 http://www.w3.org/2001/XMLSchema-instance
命名空间导入到您自己的架构中,如下所示:
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"/>
另见这个问题:使用 xjc 解析 xsd 时出错,其中虽然听起来很不一样,但实际上与同一个问题非常相关.
See also this question: Error while parsing xsd using xjc, which although sounds very differently, actually very much related to the same problem.
这篇关于“http://www.w3.org/2001/XMLSchema-instance"的 XSD 文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!