"NewsML": [
{
"Identification": {"NewsIdentifier": {
"ProviderId": "timesofindia.com",
"NewsItemId": "7954765"
}},
"NewsLines": {
"HeadLine": "I want KKR to win for Ganguly: Shah Rukh",
"DateLine": "IANS, Apr 12, 2011, 04.41am IST"
},
"NewsComponent": [
{
"Role": {"@FormalName": "WebURL"},
"ContentItem": {
"MediaType": {"@FormalName": "Link"},
"DataContent": {"media-caption": "http://timesofindia.indiatimes.com/sports/cricket/ipl-2011/news/I-want-KKR-to-win-for-Ganguly-Shah-Rukh/articleshow/7954765.cms"}
}
},
{
"Role": {"@FormalName": "Caption"},
"ContentItem": {
"MediaType": {"@FormalName": "Text"},
"DataContent": {"media-caption": "Aware of the negative vibes in Kolkata after the exclusion of Dada from the team, Shah Rukh Khan dedicated his team's victory to Sourav Ganguly."}
}
},
{
"Role": {"@FormalName": "Keywords"},
"ContentItem": {
"MediaType": {"@FormalName": "Text"},
"DataContent": {"media-keyword": "Sourav Ganguly, Shah Rukh Khan, KKR, IPL"}
}
},
{
"Role": {"@FormalName": "Photo"},
"ContentItem": {
"@Href": "http://timesofindia.indiatimes.com/photo.cms?photoid=7954812&phototype=1&width=400&height=300",
"MediaType": {"@FormalName": "Photo"},
"Format": {"@FormalName": "JPEG Baseline"},
"Characteristics": [
{
"@FormalName": "Width",
"@Value": "450"
},
{
"@FormalName": "Height",
"@Value": "300"
}
]
}
},
{
"Role": {"@FormalName": "Photo-Caption"},
"ContentItem": {
"MediaType": {"@FormalName": "Text"},
"DataContent": {"media-caption": "Kolkata Knight Riders owner Saha Rukh Khan greets his supporters during their IPL match against Deccan Chargers at Eden Gardens. (PTI photo)"}
}
},
{
"Role": {"@FormalName": "Thumb"},
"ContentItem": {
"@Href": "http://timesofindia.indiatimes.com/thumb.cms?photoid=7954812",
"MediaType": {"@FormalName": "Photo"},
"Format": {"@FormalName": "JPEG Baseline"}
}
},
{
"Role": {"@FormalName": "Story"},
"ContentItem": {
"MediaType": {"@FormalName": "Text"},
"DataContent": {"body": {"body.content": "KOLKATA: Aware of the negative vibes in Kolkata after the exclusion of local boy Sourav Ganguly from the team, Kolkata Knight Riders co-owner Shah Rukh Khan on Monday night dedicated his team's nine-run victory to Sourav Ganguly and the sports loving people of the city.\n\nI came back only for the fans. I wanted to do this for Knight Riders, the fans of Kolkata, I wanted to do this for Sourav Ganguly.\n\nI want my team KKR to win the IPL for Kolkata and Sourav Ganguly, said the matinee idol.\n\nI am very happy. It was really a cool moment. (Skipper Gautam) Gambhir and (Jacques) Kallis were really cool. It was really a cool moment as our team is unused to wins, said Shah Rukh Khan after KKR clinched their first win in IPL edition four.\n\nShah Rukh also expressed his disappointment over unnecessary controversies revolving the team for the last three seasons.\n\nA win is always welcome. We had lot of unnecessary controversies in the last three seasons, said Shah Rukh. "}}
}
}
]
},
}
]
答案 0 :(得分:0)
Json检查错误http://www.jsonlint.com/
更改了json =
{
"NewsML": [
{
"Identification": {
"NewsIdentifier": {
"ProviderId": "timesofindia.com",
"NewsItemId": "7954765"
}
},
"NewsLines": {
"HeadLine": "I want KKR to win for Ganguly: Shah Rukh",
"DateLine": "IANS, Apr 12, 2011, 04.41am IST"
},
"NewsComponent": [
{
"Role": {
"@FormalName": "WebURL"
},
"ContentItem": {
"MediaType": {
"@FormalName": "Link"
},
"DataContent": {
"media-caption": "http://timesofindia.indiatimes.com/sports/cricket/ipl-2011/news/I-want-KKR-to-win-for-Ganguly-Shah-Rukh/articleshow/7954765.cms"
}
}
},
{
"Role": {
"@FormalName": "Caption"
},
"ContentItem": {
"MediaType": {
"@FormalName": "Text"
},
"DataContent": {
"media-caption": "Aware of the negative vibes in Kolkata after the exclusion of Dada from the team, Shah Rukh Khan dedicated his team's victory to Sourav Ganguly."
}
}
},
{
"Role": {
"@FormalName": "Keywords"
},
"ContentItem": {
"MediaType": {
"@FormalName": "Text"
},
"DataContent": {
"media-keyword": "Sourav Ganguly, Shah Rukh Khan, KKR, IPL"
}
}
},
{
"Role": {
"@FormalName": "Photo"
},
"ContentItem": {
"@Href": "http://timesofindia.indiatimes.com/photo.cms?photoid=7954812&phototype=1&width=400&height=300",
"MediaType": {
"@FormalName": "Photo"
},
"Format": {
"@FormalName": "JPEG Baseline"
},
"Characteristics": [
{
"@FormalName": "Width",
"@Value": "450"
},
{
"@FormalName": "Height",
"@Value": "300"
}
]
}
},
{
"Role": {
"@FormalName": "Photo-Caption"
},
"ContentItem": {
"MediaType": {
"@FormalName": "Text"
},
"DataContent": {
"media-caption": "Kolkata Knight Riders owner Saha Rukh Khan greets his supporters during their IPL match against Deccan Chargers at Eden Gardens. (PTI photo)"
}
}
},
{
"Role": {
"@FormalName": "Thumb"
},
"ContentItem": {
"@Href": "http://timesofindia.indiatimes.com/thumb.cms?photoid=7954812",
"MediaType": {
"@FormalName": "Photo"
},
"Format": {
"@FormalName": "JPEG Baseline"
}
}
},
{
"Role": {
"@FormalName": "Story"
},
"ContentItem": {
"MediaType": {
"@FormalName": "Text"
},
"DataContent": {
"body": {
"body.content": "KOLKATA: Aware of the negative vibes in Kolkata after the exclusion of local boy Sourav Ganguly from the team, Kolkata Knight Riders co-owner Shah Rukh Khan on Monday night dedicated his team's nine-run victory to Sourav Ganguly and the sports loving people of the city.\n\nI came back only for the fans. I wanted to do this for Knight Riders, the fans of Kolkata, I wanted to do this for Sourav Ganguly.\n\nI want my team KKR to win the IPL for Kolkata and Sourav Ganguly, said the matinee idol.\n\nI am very happy. It was really a cool moment. (Skipper Gautam) Gambhir and (Jacques) Kallis were really cool. It was really a cool moment as our team is unused to wins, said Shah Rukh Khan after KKR clinched their first win in IPL edition four.\n\nShah Rukh also expressed his disappointment over unnecessary controversies revolving the team for the last three seasons.\n\nA win is always welcome. We had lot of unnecessary controversies in the last three seasons, said Shah Rukh. "
}
}
}
}
]
}
]
}
答案 1 :(得分:0)
那么,您想要将其显示给用户吗?也许我误解了你,但你可以用php在json_decode()中解析它;
此外,您可以使用JQuery解析php的JSON输出并将图像添加到HTML DOM。