Java Collada Parser - 基于 XML Pull 的实现

发布于 2024-10-06 14:32:14 字数 495 浏览 1 评论 0原文

我正在查看为 Atom、XAL、Kml 等生成的一组解析器,似乎使用自动化技术和基于 XML 拉取的解析器。实现自动化的线索是所有 XML 到 Java 映射类文件夹中都存在“package.html”。我想为相当大的 Collada 1.4 规范制作一个类似的。由于“enum”关键字,我第一次尝试 Altova 遇到了一些小问题。我确信我可以在下次运行中通过适当的重命名来修复它。 Khronos 承认 1.4 规范的设计并非对自动解析器生成友好。

实际的解析器,即XAL解析器、Atom解析器等,实现了XMLEventParser接口。我想知道是否有人遇到/使用过这种模式。如果是这样,可以使用哪个工具将 XSD 映射到类集,只需使用 getter 和 setter 即可访问节点的数据组件。

I am looking at a set of parsers generated for Atom, XAL, Kml etc. seemingly using an automated technique with a XML pull based parser. The clue towards the automation is presence of "package.html" in all XML-to-Java mapped classes folders. I would like to produce a similar one for the rather large Collada 1.4 spec. My first attempt with Altova ran into small problems due the "enum" keyword. I am sure I can fix it in the next run with appropriate renaming. Khronos admit to not designing the 1.4 spec to being automated parser generation friendly.

The actual parsers i.e. XAL parser, Atom parser etc. implement the XMLEventParser interface. I would like to know if anybody has encountered/used this pattern. If so which tool can be used to map the XSD to a class set simply giving access to the data components of the nodes using getters and setters.

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

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

发布评论

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

评论(1

作业与我同在 2024-10-13 14:32:14

我不确定我是否理解你的问题,但看来你想要处理像 Atom 这样的 XML 格式,并用 getters/setters 在对象中表示它。这可以通过 JAXB 轻松完成。

有关示例,请参阅:

I'm not sure I understand your question, but it appears that you want to process XML formats like Atom and represent it in objects with getters/setters. This can easily be done with JAXB.

For an example see:

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