问题
How can I get java classes from an xml file?
In this situation, I don't have an XML schema and this way I can't use JAXB, Castor or other xml binding API as far as I know.
回答1:
You can generate schema from XML file using certain tools. Then, use Apache XMLBEANS to create your classes.
回答2:
XStream is great for XML -> objects and vice versa. Fast, lightweight, and works well without any schema.
回答3:
Altova is also the best to generate java Classes from XML/XSD
来源:https://stackoverflow.com/questions/2447213/generating-java-classes-from-xml-file