From 48fe3f96972f742689ac3eaa784dd7fb78f3001e Mon Sep 17 00:00:00 2001 From: Charles Banning Date: Wed, 28 Nov 2018 12:54:15 -0700 Subject: [PATCH] fix UnknownXMLTags for simple elements --- unknowntags.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unknowntags.go b/unknowntags.go index a1478cc..6480430 100644 --- a/unknowntags.go +++ b/unknowntags.go @@ -338,6 +338,9 @@ func checkAllTags(mv interface{}, val reflect.Value, s *[]string, key string) { // 5. check that map keys correspond to exported field names // We handle the keys in the map literally, unlike for encoding/json. + // But first remove any "#text" keys if it's a simple element. + delete(mm, "#text") + var spec *fieldSpec for k, m := range mm { for _, sk := range skiptags {