How to get this XmlAttribute

Posted by user328738 on Stack Overflow See other posts from Stack Overflow or by user328738
Published on 2010-04-29T09:54:08Z Indexed on 2010/04/29 9:57 UTC
Read the original article Hit count: 344

Filed under:
|
|
|

From the MusicBrainz REST service, I get the following xml:

<artist-list offset="0" count="59">
  <artist type="Person" id="xxxxx" ext:score="100">
  ...

Using WCF and XmlSerializationFormat, I'm able to get the type and id attributes... but How do I get the "ext:score" one?

This works:

  public class Artist
  {
    [XmlAttribute("id")]
    public string ID { get; set; }

    [XmlAttribute("type")]
    public ArtistType Type { get; set; }

But this doesnt:

[XmlAttribute("ext:score")]
public string Score { get; set; }

It produces a serialization exception. I've also tried just using "score", but it doesn't work.

Any help?

© Stack Overflow or respective owner

Related posts about rest

Related posts about Xml