mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +08:00
1 parent
3f797e656b
commit
91e5b57e24
43 files changed
+2018
-384
No files matched your search
@@ -42,8 +42,11 @@ func encodeStructureNode(node StructureNode) ([]byte, error) {
|
||||
return err
|
||||
}
|
||||
start := xml.StartElement{Name: xml.Name{Space: node.Namespace, Local: node.Name}}
|
||||
if node.Namespace == "" {
|
||||
switch node.Namespace {
|
||||
case "":
|
||||
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: ""})
|
||||
case "http://www.w3.org/XML/1998/namespace":
|
||||
start.Name = xml.Name{Local: "xml:" + node.Name}
|
||||
}
|
||||
for _, attr := range node.Attributes {
|
||||
start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Space: attr.Namespace, Local: attr.Name}, Value: attr.Value})
|
||||
|
||||
Reference in new issue
Block a user