Standard library / encoding/xml
encoding/xml.Attr
An attribute consists of a namespace-aware Name and a string Value. Expected stdout: 'id 7\n'.
Formal Syntax & Structure
go syntaxgo
type Attr struct { Name Name Value string}Working Example
Example Snippetgo
package main
import ( "encoding/xml" "fmt")
func must(e error) { if e != nil { panic(e) }}
func main() { a := xml.Attr{Name: xml.Name{Local: "id"}, Value: "7"} fmt.Println(a.Name.Local, a.Value)}