fixed same extentions space on root level
This commit is contained in:
parent
c06dd6d193
commit
7daa266b18
3 changed files with 5 additions and 4 deletions
5
rss.go
5
rss.go
|
@ -182,11 +182,11 @@ func (this *Feed) readRss2(doc *xmlx.Document) (err error) {
|
|||
}
|
||||
|
||||
tl = item.SelectNodes("*", "*")
|
||||
i.Extensions = make(map[string]*Extension)
|
||||
i.Extensions = make(map[string][]*Extension)
|
||||
for _, lv := range tl {
|
||||
e, ok := getExtension(lv)
|
||||
if ok {
|
||||
i.Extensions[lv.Name.Space] = e
|
||||
i.Extensions[lv.Name.Space] = append(i.Extensions[lv.Name.Space], e)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,6 +202,7 @@ func getExtension(node *xmlx.Node) (*Extension, bool) {
|
|||
var extension Extension
|
||||
extension = Extension{Name: node.Name.Local, Value: node.GetValue()}
|
||||
extension.Attrs = make(map[string]string)
|
||||
|
||||
for _, x := range node.Attributes {
|
||||
extension.Attrs[x.Name.Local] = x.Value
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue