How to generate JAXB classes from just XML

前端 未结 3 1256
执笔经年
执笔经年 2020-11-30 21:20

I need to generate classes from xml that doesn\'t provide a schema. I understand this is near useless, but the fact is we have xml, it\'s structured, and we should be able t

3条回答
  •  爱一瞬间的悲伤
    2020-11-30 21:44

    There are many tools available (a quick google search should fetch you some) that can generate XSD from XML assuming string type for almost everything. You should be able to use that XSD to run JAXB to get classes.

    Here's an online tool that lets you do that.

    And here is a screen cap: enter image description here

提交回复
热议问题