Remove xsi:type, xmlns:xs, and xmlns:xsi from JAXB Generics

后端 未结 3 1303
一向
一向 2021-01-18 16:39

When using JAXB, I\'d like to remove the excess namespaces/types from my XML elements when using Generics. How can I do this or what am I doing wrong? I\'d like to use Gen

3条回答
  •  执笔经年
    2021-01-18 17:08

    I was able to use @XmlAnyElement(lax=true) on the property that was causing me problems due to the generic parameter, then had to add an @XmlRootElement on the actual class that was being marshalled, and the declaration went away! Fantastic!

提交回复
热议问题