99问答网
所有问题
如何让自定义类型在xml.Marshal下生成CDATA格式
如题所述
举报该问题
推荐答案 2017-05-29
参考:
func (c CDATA) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return e.EncodeElement(struct {
string `xml:",cdata"`
}{string(c)}, start)
}
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://99.wendadaohang.com/zd/WzXW7WXtOXOzOBtBWXj.html
相似回答
大家正在搜
相关问题
解析xml时,在读取cdata数据怎样还原其内容格式
java 把“<"输出到xml文件---xml转义问题
JAVA 生成xml格式,具体格式如下,请问JAVA方法怎么...
java 构造带CDATA节点的xml
xml中CDATA中的]]>怎么处理
java 读XML时 <![CDATA段是否需要特殊处理? ...
xml元素类型PCDATA和CDATA的区别
xml里面的数据类型有哪几种?分别有什么作用?