jquery - why json key shows a minus sign in its name when its assigned with a string number? -


hi have following xml converted json

<?xml version="1.0" encoding="utf-8" ?> <category>     <sports id="100">         <indoor id="1000">             <basketball id="100k" />             <pool id="200k" />         </indoor>         <outdoor id="2000">             <hockey id="300k" />             <baseball id="400k" />         </outdoor>     </sports>     <electric id="200">         <entertainment id="3000">             <tv id="500k" />             <hifi id="600k" />         </entertainment>         <kitchen id="4000">             <kettles id="700k" />         </kitchen>     </electric> </category> 

when json shows minus on key "id" when assigned number

    {   "category": {     "sports": {       "-id": "100",       "indoor": {         "-id": "1000",         "basketball": { "-id": "100k" },         "pool": { "-id": "200k" }       },       "outdoor": {         "-id": "2000",         "hockey": { "-id": "300k" },         "baseball": { "-id": "400k" }       }     },     "electric": {       "-id": "200",       "entertainment": {         "-id": "3000",         "tv": { "-id": "500k" },         "hifi": { "-id": "600k" }       },       "kitchen": {         "-id": "4000",         "kettles": { "-id": "700k" }       }     }   } } 

why shows number? normal or should modify "id" property not have minus?

that converter using '-' attributes prefix. use 1 instead, can choose character want prefixes: http://www.freeformatter.com/xml-to-json-converter.html


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -