问题描述
我想从一个 RelaxNG Schema 中生成一个对象模型.
I want to generate an object model out of an RelaxNG Schema.
因此我想使用 RNGOM 对象模型/解析器(主要是因为我找不到任何替代方案- 虽然我什至不关心解析器编写/生成的语言).现在我从 SVN 查看了 RNGOM 源代码,我不知道怎么做使用 RNOM,因为没有任何关于使用的信息.
Therefore I want to use the RNGOM Object Model/Parser (mainly because I could not find any alternative - although I don't even care about the language the parser is written in/generates). Now that I checked out the RNGOM source from SVN, I don't have ANY idea how to use RNGOM, since there is not any piece of information out there about the usage.
一个有用的提示如何开始使用 RNGOM - 一个链接、示例或任何描述,使我不必阅读理解 RNGOM 的整个源代码 - 将作为答案授予.更好的是如何使用解析器从 RNG 文件生成对象模型的简单示例.
A useful hint how to start with RNGOM - a link, example, or any description which saves me from having to read understand the whole source code of RNGOM - will be awarded as an answer. Even better would be a simple example how to use the parser to generate an Object model out of an RNG file.
更多信息:
我想从下面的 RelaxNG Schema 中生成 Java 类:
http://libvirt.org/git/?p=libvirt.git;a=tree;f=docs/schemas;hb=HEAD
I want to generate Java classes out of the following RelaxNG Schema:
http://libvirt.org/git/?p=libvirt.git;a=tree;f=docs/schemas;hb=HEAD
我发现 Glassfish 的人正在使用 rgom 来生成我需要的相同对象模型,但我还不知道他们是如何使用 rgom 的.
I found out that the Glassfish guys are using rngom to generate the same object model I need, but I could not yet find out how they are using rngom.
推荐答案
一种方法可以是:
- 使用 jing 从 Relax NG 转换为 XML Schema(看这里)
- 使用更常用的工具来生成类(例如 JaxB).
这篇关于使用 RNOM 从 RelaxNG 模式生成对象模型 - 如何开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!