An Internet resource for generating a Java class from an XML file

Is there a website that will use an example XML file for input and generate a (crude) Java class based on the elements (not the data) in the file? I have a sample XML with a model size that I need to do some work with and would prefer not to create a Java class representation for it.

If there is no good online resource, the Eclipse plugin or the Windows executable will also work.

+9
source share
4 answers

(link not working) Please ignore this answer.

-12
source

I use this from here:

http://pojo.sodhanalibrary.com/

It creates a POJO for XML and JSON inputs

+9
source

Note. I am the leader of the EclipseLink JAXB (MOXy) and I am a member of the JAXB 2 Expert Group ( JSR-222 ).

It is best to generate an XML schema from an XML document, and then generate an object model from an XML schema using JAXB.

Example - Generating a JAXB Object Model from an XML Schema

You can use the Dali plugin in Eclipse to generate Java classes using JAXB:

+5
source

Pretty old question, but if someone is looking for an alternative to the ones already mentioned, here is the one that generates a single file with inner classes

https://codebeautify.org/xml-to-java-converter

0
source

Source: https://habr.com/ru/post/890513/


All Articles