如何始终从 W3C 引用最新版本的 xml.xsd?

How to always reference the latest version of xml.xsd from W3C?

许多 XML 模式我使用参考 xml.xsd 例如因此:

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

schemaLocation 值引用了 XSD 的特定版本。

是否可以参考 "the most recent version W3C's xml.xsd" 而不是 "this version" 并返回检查更新/将不同的模式与同一版本对齐等?

如果您阅读该文档中的 "Versioning policy for this schema document" 部分,您会发现此政策正是您所要求的:

The schema document at that URI may however change in the future, in order to remain compatible with the latest version of XML Schema itself, or with the XML namespace itself. In other words, if the XML Schema or XML namespaces change, the version of this document at http://www.w3.org/2001/xml.xsd will change accordingly; the version at http://www.w3.org/2009/01/xml.xsd will not change.