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

后端 未结 3 1308
一向
一向 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:29

    i get the same problem, and resolved it by the advice from Programmatically determine if a JAXB annotation will result in a xsi:type annotation?

    just using @XmlAnyElement(lax=true) instead of using @XmlElement on the generic class object (value for this sample).

提交回复
热议问题