Java 相当于 .NET 的 System.Xml.Schema 类?
.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
完成此任务的工具已经存在,但我认为 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.