XML 模式来验证 XML 模式?

发布于 2024-09-28 07:41:13 字数 68 浏览 1 评论 0原文

有谁知道是否可以使用另一个 XML 模式验证 XML 模式?如果是这样,是否有参考实现?我想使用 JAXB 解析架构文档。

Does anyone know if its possible to validate an XML schema with another XML schema? If so, is there a reference implementation out there? I would like to parse a Schema doc using JAXB.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

当然。大多数时候,您只需将浏览器指向用作 XML 文档命名空间的 URL。这也适用于 XML 架构: http://www.w3.org/2001/XMLSchema

XSD 从那里链接。

Of course. Most of the time you can just point your browser to the URL that serves as the namespace for the XML document. This also works with XML Schema: http://www.w3.org/2001/XMLSchema

The XSD is linked from there.

苏璃陌 2024-10-05 07:41:13

另请检查 XSOM。这就是 JAXB RI 用于加载和处理 XSD 的方法。

Also check XSOM. This is what JAXB RI uses to load and process XSDs.

木落 2024-10-05 07:41:13

XML 架构定义语言 (XSD) 有两个版本:1.0 和 1.1。 1.0 版于 2001 年发布,1.1 版于 2009 年发布。

规范的 XSD 架构为:

您可以通过命令行测试 XSD 架构的验证,例如:

$ xmllint -noout -schema XMLSchema.xsd myschema.xsd

There are two versions of the XML Schema Definition Language (XSD): 1.0 and 1.1. Version 1.0 was released in 2001 and version 1.1 was released in 2009.

The normative XSD schemas are:

You can test the validation of an XSD schema via the command line, e.g.:

$ xmllint -noout -schema XMLSchema.xsd myschema.xsd
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文