我正在序列化我的 Java 模型以ATOM
使用JAXB
. 对于 Object 类型的 title 属性(我无法将其更改为 a String
),它正在添加命名空间属性。
<atom:title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">
myTitle
</atom:title>
这应该是:
<atom:title>myTitle</atom:title>