diff options
author | xuri <xuri.me@gmail.com> | 2021-04-30 00:14:42 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-04-30 00:14:42 +0800 |
commit | 7e429c5b464b53f305e94cc355f14ba9e1d9849c (patch) | |
tree | c732503f48464b6303291d2538f80d170c4bc913 /lib.go | |
parent | af5e87dbcf5a89201072f5ca07d532258ece278f (diff) |
Fixe issue generated file corrupted caused by incorrect default XML namespace attributes
Diffstat (limited to 'lib.go')
-rw-r--r-- | lib.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -349,6 +349,9 @@ func genXMLNamespace(attr []xml.Attr) string { var rootElement string for _, v := range attr { if lastSpace := getXMLNamespace(v.Name.Space, attr); lastSpace != "" { + if lastSpace == NameSpaceXML { + lastSpace = "xml" + } rootElement += fmt.Sprintf("%s:%s=\"%s\" ", lastSpace, v.Name.Local, v.Value) continue } |