Java 相当于 .NET 的 System.Xml.Schema 类?

发布于 2024-09-10 21:57:17 字数 283 浏览 1 评论 0原文

.NET Framework 公开了一组相当有用的类,作为 System.Xml.Schema 命名空间

除此之外,XmlSchema 和 XmlSchemaElement 等类提供了有用的 API,用于定义/写入和解析/读取/遍历 XML 架构文件。

Java 是否存在等效的库?

The .NET Framework exposes a rather useful set of classes as part of the System.Xml.Schema namespace.

Among other things, classes such as XmlSchema and XmlSchemaElement provide a useful API for defining/writing and parsing/reading/traversing XML schema files.

Does an equivalent library exist for Java?

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

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

发布评论

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

评论(1

浪菊怪哟 2024-09-17 21:57:18

完成此任务的工具已经存在,但我认为 Java 中没有任何特定的工具。我要做的是在 XML Schema 模式 (http://www.w3.org/2001/XMLSchema) 上运行 JAXB,这将生成与 XSD 构造相对应的 Java 类。然后,您可以使用它们来读取/写入 XML 模式,并根据 XML 模式模式进行验证。

The tools to accomplish this are there, but I don't think there's anything specific like that in Java. What I would do is run JAXB on the XML Schema schema (http://www.w3.org/2001/XMLSchema), which will generate Java classes corresponding to the XSD constructs. Then you can use those to read/write XML schemas, and validate against the XML Schema schema.

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