问题描述
我想用RelaxNG Schema生成一个对象模型。
I want to generate an object model out of an RelaxNG Schema.
因此我想使用(主要是因为我找不到任何替代方案 - 尽管我甚至不关心解析器编写/生成的语言)。现在我从SVN查看了,我不知道如何使用RNGOM,因为那里没有关于用法的任何信息。
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模式生成Java类:
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的人正在使用rngom生成我需要的相同对象模型,但是我还不知道他们是如何使用rngom的。
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)。
这篇关于使用RNGOM从RelaxNG模式生成对象模型 - 如何开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!