【发布时间】:2011-09-03 12:42:40
【问题描述】:
我正在使用以下 xml 结构在我的网站上创建 xml 提要,其中项目部分根据从数据库返回的行数循环多次。
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>title goes here</title>
<link>link goes here</link>
<atom:link href="url goes here" rel="self" type="application/rss+xml" />
<description>description goes here</description>
<item>
<title>title goes here</title>
<link>url goes here</link>
<guid>id goes here</guid>
<pubDate>data goes here</pubDate>
<description>description goes here</description>
</item>
</channel>
</rss>
我现在需要使用jsonp。构造json数据以json形式返回上述数据的最佳方法是什么?
【问题讨论】: