github.com/yaegashi/msgraph.go@v0.1.4/gen/generator_xml.go (about)

     1  package main
     2  
     3  import "encoding/xml"
     4  
     5  type Elem struct {
     6  	XMLName xml.Name
     7  	Attrs   []xml.Attr `xml:",any,attr"`
     8  	Elems   []Elem     `xml:",any"`
     9  }
    10  
    11  func (e *Elem) AttrMap() map[string]string {
    12  	m := map[string]string{}
    13  	for _, x := range e.Attrs {
    14  		m[x.Name.Local] = x.Value
    15  	}
    16  	return m
    17  }