首页 > xml: unsupported type: map[string]interface {}

xml: unsupported type: map[string]interface {}

xml如何与map[string]interface {}互相转换?

http://stackoverflow.com/questions/30928770/marshall-map-to-xml-in-go


xml -> map[string]interface {}

import "encoding/xml"
str是xml格式的的字符串,
result为对应的结构体
通过xml.Unmarshal([]byte(str), &result)就可以解析对应的xml文件了

map[string]interface {} -> xml
通过遍历map来生成

【热门文章】
【热门文章】