php+xml 问题,在线等
在php页面中,通过下面的sql
select * from base_stories order by dateposted desc limit 100;
可以得到 表中100记录的字段:标题,内容 等.
现要把这些标题,内容等放到一个news.xml中去:
news.xml 如下:
<?xml version="1.0" encoding="GB2312" ?>
<document>
<webSite>http://899.cn/</webSite>
<webMaster>350038760@qq.com</webMaster>
<updatePeri>15</updatePeri>
<item>
<link>http://899.cn/xinwen/1392.html</link>
<title>房价急升质量存疑 迷样楼市如何智慧买房?</title>
<text>楼盘</text>
<image>../upload/newsPic/pic/20090710093930385049975.jpg</image>
<category>全国地产新闻</category>
<pubDate>2009-07-10 09:55:20</pubDate>
</item>
</document>
其中 一个 item为一条新闻的有关内容,item中的link title text image category pubDate
都可从 base_stories表中取到值,
100条记录,就是要在此xml中生成100个item,
请问这功能怎么实现,