Files
Sillyv2/core/node_xml.go
T
cdle 458c22e421 x
2023-06-08 23:04:38 +08:00

22 lines
420 B
Go

package core
import (
"github.com/clbanning/mxj"
)
func (sender *Strings) ParseXml(str string) map[string]interface{} {
m, err := mxj.NewMapXml([]byte(str))
if err != nil {
console.Error("xml解析错误:", err)
}
return m
}
func (sender *Strings) Xml(m map[string]interface{}) string {
xmlStr, err := mxj.Map(m).Xml()
if err != nil {
console.Error("xml编码错误:", err)
}
return string(xmlStr)
}