diff --git a/xml.go b/xml.go index c1b618d..97fb295 100644 --- a/xml.go +++ b/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