Golang encoding/xml.Attr type examples

package encoding/xml

An Attr represents an attribute in an XML element (Name=Value).

Golang encoding/xml.Attr type usage examples

Example 1 :

 func (e StartElement) Copy() StartElement {
 attrs := make([]Attr, len(e.Attr))
 copy(attrs, e.Attr)
 e.Attr = attrs
 return e
 }

Example 2:

 xml.Attr{{xml.Name{"", "xmlns"}, "https://route53.amazonaws.com/doc/2014-03-01/"}}

Reference :

http://golang.org/pkg/encoding/xml/#Attr

Advertisement