简体   繁体   English

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

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

Many XML schemas I use reference xml.xsd eg thus: 因此,我使用了许多XML模式,例如使用参考xml.xsd:

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

This schemaLocation value references a specific version of the XSD. schemaLocation值引用XSD的特定版本。

Is it possible to refer to the "the most recent version W3C's xml.xsd" rather than "this version" and going back to check for updates / aligning different schemas to the same version, etc.? 是否可以引用“ W3C的最新版本xml.xsd”而不是“此版本”,然后返回以检查更新/将不同的模式与同一版本对齐,等等?

If you read the "Versioning policy for this schema document" section in that document, you will see that this policy is precisely what you ask for: 如果阅读该文档中的“此架构文档的版本策略”部分,您将看到此策略正是您所要求的:

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. 但是,该URI上的模式文档将来可能会更改,以便与XML Schema本身的最新版本或与XML名称空间本身兼容。 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; 换句话说,如果XML Schema或XML名称空间发生更改,则位于http://www.w3.org/2001/xml.xsd的本文档的版本将相应更改; the version at http://www.w3.org/2009/01/xml.xsd will not change. http://www.w3.org/2009/01/xml.xsd上的版本不会更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM