0

I have converted an XML document to JSON using Newtonsoft Library in .NET.

Some of the converted XML nodes have attributes, like this (once converted):

"HandID": {
  "@Room": "",
  "#text": "1"
},

In JavaScript the Hand is an object.

Question: how do I get the @room or the #text values in JavaScript?

user3553401
  • 109
  • 2
  • 15
  • @Quentin: your comment is not very useful!!! How do I find the original question if you don't provide the link? How can I say it is different, or same? – user3553401 Mar 05 '15 at 16:56
  • I haven't made a commnet. You're seeing a standard Stackoverflow closed question template. See also http://note.io/1aN6ZpF – Quentin Mar 05 '15 at 16:59
  • The difference is that my object is a JSON one, and when I use brackets notation Hand.[text] there is an "Identifier expected" js error. Please leave my question open. – user3553401 Mar 05 '15 at 17:14
  • It isn't JSON after you parse it. `Hand.[text]` would give that error since it isn't the syntax shown in the duplicate question. – Quentin Mar 05 '15 at 17:16

0 Answers0