从 XML 文件生成 Java 类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2447213/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Generating Java classes from XML file
提问by marionmaiden
How can I get java classes from an xml file?
如何从 xml 文件中获取 java 类?
In this situation, I don't have an XML schemaand this way I can't use JAXB, Castor or other xml binding API as far as I know.
在这种情况下,我没有XML 模式,因此据我所知,我无法使用 JAXB、Castor 或其他 xml 绑定 API。
回答by Pablo Santa Cruz
You can generate schema from XML file using certain tools. Then, use Apache XMLBEANSto create your classes.
您可以使用某些工具从 XML 文件生成模式。然后,使用Apache XMLBEANS创建您的类。

