Generate Java classes from .XSD files…?

Generate Java classes from .XSD files…?

Asked on December 27, 2018 in XML.
Add Comment


  • 3 Answer(s)

    Generating java classes from the xsd files:

         JAXB will do EXACTLY our needs. It is built into the JRE/JDK which is starting at 1.6.

    Answered on December 27, 2018.
    Add Comment

    To distend on the “use JAXB” follow the given:

    In Windows,

    "%java_home%\bin\xjc" -p [your namespace] [xsd_file].xsd
    

    Example,

    "%java_home%\bin\xjc" -p com.mycompany.quickbooks.obj quickbooks.xsd
    

         If the user have a well-formed XSD file, then they will get some well-formed Java classes.

    Answered on December 27, 2018.
    Add Comment

    To generate java clases from xsd file by using Eclipse IDE:

    • copy the xsd into a new/existing project.
    • Make sure that we have JAXB required JARs in classpath. Download one here.
    • Right click on the XSD file -> Generate -> JAXB classes.

     

    Answered on December 27, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.