x
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
@@ -11,6 +11,7 @@ require (
|
||||
github.com/beego/beego/v2 v2.1.0
|
||||
github.com/boltdb/bolt v1.3.1
|
||||
github.com/buger/jsonparser v1.1.1
|
||||
github.com/clbanning/mxj v1.8.4
|
||||
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58
|
||||
github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3
|
||||
github.com/dop251/goja_nodejs v0.0.0-20230602164024-804a84515562
|
||||
@@ -61,6 +62,6 @@ require (
|
||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||
golang.org/x/crypto v0.9.0 // indirect
|
||||
golang.org/x/sys v0.8.0 // indirect
|
||||
golang.org/x/text v0.9.0
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
google.golang.org/protobuf v1.30.0 // indirect
|
||||
)
|
||||
|
||||
@@ -17,6 +17,8 @@ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583j
|
||||
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
|
||||
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
|
||||
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=
|
||||
github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng=
|
||||
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg=
|
||||
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
|
||||
Reference in New Issue
Block a user