views:

32

answers:

0

I am using Newtonsoft Json.Net to convert Xml to Json. Following Xml

<root>
  <person id="1">
  <name type="first">Alan</name>
  <url>http://www.google.com&lt;/url&gt;
  </person>
  <person id="2">
  <name type="last">Louis</name>
  <url>http://www.yahoo.com&lt;/url&gt;
  </person>
</root>

Is converted to following Json.

{
  "root": {
    "person": [
      {
        "@id": "1",
        "name": {
          "@type": "first",
          "#text": "Alan"
        },
        "url": "http://www.google.com"
      },
      {
        "@id": "2",
        "name": {
          "@type": "last",
          "#text": "Louis"
        },
        "url": "http://www.yahoo.com"
      }
    ]
  }
}

Is there way I can remove @ prefix from the attributes as it gives error when the converted json is consumed in IE 8.0 and Chrome.