我有一个从 XML 转换并保留“@attributes”的 json:
{"stop":"1021","route":"0057","direction":"1","departures":{"departure":[
{"@attributes":{"accurate":"1","headsign":"Rennes R"},"content":"2013-03-25T12:00:23+01:00"},
{"@attributes":{"accurate":"0","headsign":"Rennes R"},"content":"2013-03-25T12:20:00+01:00"},
{"@attributes":{"accurate":"0","headsign":"Rennes R"},"content":"2013-03-25T12:40:00+01:00"}]}},...
您可以在这里访问 javascript [1] 中的属性:
departure[0]["@attributes"].accurate
但是如果你想用 Meteor 在模板中抓取它,你怎么做呢?
[1] JSON @属性