私は次のクラスを持っています:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "item", propOrder = {
"content"
})
public class Item {
@XmlElementRefs({
@XmlElementRef(name = "ruleref", type = JAXBElement.class, required = false),
@XmlElementRef(name = "tag", type = JAXBElement.class, required = false),
@XmlElementRef(name = "one-of", type = JAXBElement.class, required = false),
@XmlElementRef(name = "item", type = JAXBElement.class, required = false)
})
@XmlMixed
protected List<Serializable> content;
要素には、次のような引用符を含む文字列を含めることができます。
<tag>"some kind of text"</tag>
さらに、item 要素自体に、引用符を含む文字列を含めることができます。
<item>Some text, "this has string"</item>
Moxy を使用して生成された XML は、タグ要素とアイテム要素のテキスト値をエスケープします。
<tag>"e;some kind of text"e;</tag>
どうすればそれを防ぐことができますが、これらの要素でのみですか? 属性やその他の要素はそのままにしておく必要があります (つまり、エスケープします)。
ありがとうございました。