AnyMap -> XmlStringMap
This commit is contained in:
parent
8b8d3c3384
commit
ecb0211345
10
xml.go
10
xml.go
@ -68,14 +68,14 @@ func (o *ownXml) MarshalForStringIgnoreError(input any) string {
|
||||
return str
|
||||
}
|
||||
|
||||
type AnyMap map[string]any
|
||||
type XmlStringMap map[string]string
|
||||
|
||||
type xmlMapEntry struct {
|
||||
XMLName xml.Name
|
||||
Value any `xml:",chardata"`
|
||||
Value string `xml:",chardata"`
|
||||
}
|
||||
|
||||
func (m *AnyMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
func (m *XmlStringMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
if nil == m {
|
||||
return nil
|
||||
}
|
||||
@ -95,8 +95,8 @@ func (m *AnyMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
return e.EncodeToken(start.End())
|
||||
}
|
||||
|
||||
func (m *AnyMap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
||||
*m = AnyMap{}
|
||||
func (m *XmlStringMap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
||||
*m = XmlStringMap{}
|
||||
for {
|
||||
var e xmlMapEntry
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user