From 7e429c5b464b53f305e94cc355f14ba9e1d9849c Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 30 Apr 2021 00:14:42 +0800 Subject: Fixe issue generated file corrupted caused by incorrect default XML namespace attributes --- lib.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib.go') diff --git a/lib.go b/lib.go index 26d402a..3a9e807 100644 --- a/lib.go +++ b/lib.go @@ -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 } -- cgit v1.2.1