Remove namespace prefix while JAXB marshalling

前端 未结 5 1844
無奈伤痛
無奈伤痛 2020-11-29 05:45

I have JAXB objects created from a schema. While marshalling, the xml elements are getting annotated with ns2. I have tried all the options that exist over the net for this

5条回答
  •  爱一瞬间的悲伤
    2020-11-29 06:40

    I got the working result by the setting the property:

    marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "");
    

提交回复
热议问题