{"action":"reopened","issue":{"url":"https://api.github.com/repos/clbanning/mxj/issues/15","repository_url":"https://api.github.com/repos/clbanning/mxj","labels_url":"https://api.github.com/repos/clbanning/mxj/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/clbanning/mxj/issues/15/comments","events_url":"https://api.github.com/repos/clbanning/mxj/issues/15/events","html_url":"https://github.com/clbanning/mxj/issues/15","id":137719951,"number":15,"title":"Edge case for XML conversion","user":{"login":"arcanechimp","id":8119992,"avatar_url":"https://avatars.githubusercontent.com/u/8119992?v=3","gravatar_id":"","url":"https://api.github.com/users/arcanechimp","html_url":"https://github.com/arcanechimp","followers_url":"https://api.github.com/users/arcanechimp/followers","following_url":"https://api.github.com/users/arcanechimp/following{/other_user}","gists_url":"https://api.github.com/users/arcanechimp/gists{/gist_id}","starred_url":"https://api.github.com/users/arcanechimp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcanechimp/subscriptions","organizations_url":"https://api.github.com/users/arcanechimp/orgs","repos_url":"https://api.github.com/users/arcanechimp/repos","events_url":"https://api.github.com/users/arcanechimp/events{/privacy}","received_events_url":"https://api.github.com/users/arcanechimp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-01T23:27:16Z","updated_at":"2016-03-02T13:29:44Z","closed_at":null,"body":"When converting from XML to a map I have found that a string value of \"NAN\", gets cast to a float value as a NaN. This is not the desired result in this particular case, as it is actually a string value.\r\n\r\nThere is no NaN equivalent in JSON, so when converting from a Map to JSON, I get an error: \r\njson: unsupported value: NaN\r\n\r\nI assume this issue would also arise if there was a string value of \"Inf\" or \"-Inf\".\r\n\r\nI have written a small example below to replicate the issue.\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\r\n\t\"github.com/clbanning/mxj\"\r\n)\r\n\r\nfunc main() {\r\n\tvar xml = []byte(\"<foo><bar>NAN</bar></foo>\")\r\n\r\n\tm, err := mxj.NewMapXml(xml, true)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tfmt.Print(m.StringIndent())\r\n\tfmt.Println()\r\n\r\n\tj, err := m.JsonIndent(\"\", \"  \", true)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tfmt.Print(string(j))\r\n}\r\n```"}}