c#如何生成这种格式的xml <bbs:hit>0</bbs:hit> ???
<?xml version="1.0" encoding="GB2312" ?>
- <document xmlns:bbs="http://www.baidu.com/search/bbs_sitemap.xsd">
<webSite>http://bbs.lgfun.com</webSite>
<webMaster>lirenvip@qq.com</webMaster>
<updatePeri>24</updatePeri>
<updatetime>2008-11-28 9:26:20</updatetime>
<version>乐购坊论坛</version>
- <item>
<link>http://bbs.sina.com/dispbbs.asp?boardid=7&ID=8641</link>
<title>免费为个体工商户安装银联POS机</title>
<pubDate>2008-11-26 21:15:00</pubDate>
<bbs:lastDate>2008-11-26 21:15:00</bbs:lastDate>
<bbs:reply>0</bbs:reply>
<bbs:hit>2</bbs:hit>
<bbs:mainLen>16</bbs:mainLen>
<bbs:boardid>7</bbs:boardid>
<bbs:pick>0</bbs:pick>
</item>
- <item>
<link>http://bbs.sina.com/dispbbs.asp?boardid=5&ID=8640</link>
<title>免费为个体工商户安装银联POS机</title>
<pubDate>2008-11-26 21:15:00</pubDate>
<bbs:lastDate>2008-11-26 21:15:00</bbs:lastDate>
<bbs:reply>0</bbs:reply>
<bbs:hit>1</bbs:hit>
<bbs:mainLen>16</bbs:mainLen>
<bbs:boardid>5</bbs:boardid>
<bbs:pick>0</bbs:pick>
</item>
- <item>
</document>
我用XmlDocument来生成的,但是其中象<bbs:hit>0</bbs:hit>这种情况,不知道要如何才能生成,我用
XmlElement bbshit = objDoc.CreateElement("bbs:hit","");
bbshit.InnerText = objReader["hits"].ToString().Trim();
item.AppendChild(bbshit);
结果只生成了<hit>0</hit>
就是冒号及前面的部分没有出来,要怎么作才能生成<bbs:hit>0</bbs:hit>这种???
------解决方案--------------------
我也不太懂,给你推荐一篇参考
http://dotnet.aspx.cc/article/7b4c7a42-4cdf-40d1-b293-e86da109a34c/read.aspx