title: How to unmarshal XML attributes with colons?
body: <p>Some SVG/XML files I'm working with have dashes and colons in attribute names - for example:</p>
  
  <pre><code>&lt;g&gt;
    &lt;a xlink:href="http://example.com" data-bind="121"&gt;...&lt;/a&gt;
  &lt;/g&gt;
  </code></pre>
  
  <p>I'm trying to figure out how to unmarshal these attributes using <a href="http://golang.org" rel="nofollow noreferrer"><code>golang</code></a>'s <a href="http://golang.org/pkg/encoding/xml" rel="nofollow noreferrer"><code>encoding/xml</code></a> package. While the dashed attributes works, the ones with the colon doesn't:</p>
  
  <h2>[<a href="http://play.golang.org/p/tuDunv39S9" rel="nofollow noreferrer">See here for a live example</a>]</h2>
  
  <pre><code>package main
  
  import (
      "encoding/xml"
      "fmt"
  )
  
  var data = `
  &lt;g&gt;
      &lt;a xlink:href="http://example.com" data-bind="121"&gt;lala&lt;/a&gt;
  &lt;/g&gt;
  `
  
  type Anchor struct {
      DataBind  int    `xml:"data-bind,attr"`  // this works
      XlinkHref string `xml:"xlink:href,attr"` // this fails
  }
  
  type Group struct {
      A Anchor `xml:"a"`
  }
  
  func main() {
      group := Group{}
      _ = xml.Unmarshal([]byte(data), &amp;group)
  
      fmt.Printf("%#v\n", group.A)
  }
  </code></pre>
  
  <p>These are <a href="https://stackoverflow.com/a/1478623/187907">seemingly legal</a> attribute names; any idea how to extract the <code>xlink:href</code> one? thanks.</p>