有想查看xml结尾源文件,出现了问题,看不了?

appreciatewo 2009-02-04 03:06:53
http://news.wuhan.net.cn/new/148/index.xml


doc=getXmlDoc(document.URL);这里用到这个方法来读取,所以说我想用c#来改写这方法,使得同样能够读取的出来,谢谢,不知道我是否准确的读懂了代码的意思。

window.onload=function(){
var doc=getXmlDoc(document.URL);
var pitems=doc.selectNodes("/whol/Page");
var cin=pitems[0].attributes[0].value;
var tot=pitems[0].attributes[1].value;
showPage(cin,tot);

var titems=doc.selectNodes("/whol/Types/Type");
showType(titems);
}
///////////////////////////////////////////////////////////////////////////////////////
function showPage(cindex,total){//显示内容多页
if (total==1) return;
var t=document.getElementById("Pager");
var pg="这是第"+cindex+"页 共"+total+"页 ";
t.appendChild(document.createTextNode(pg));

var fp=document.createElement("A");
var pp=document.createElement("A");
var np=document.createElement("A");
var lp=document.createElement("A");
var p=cindex-1;
var n=p+2;

fp.appendChild(document.createTextNode("首页"));
pp.appendChild(document.createTextNode("上一页"));
np.appendChild(document.createTextNode("下一页"));
lp.appendChild(document.createTextNode("末页"));
if(cindex!=1) fp.href="index.xml";
if(cindex==2) pp.href="index.xml";
else if(cindex!=1) pp.href="index"+p+".xml";
if(cindex!=total){
np.href="index"+n+".xml";
lp.href="index"+total+".xml";
}
t.appendChild(fp);
t.appendChild(document.createTextNode(" "));
t.appendChild(pp);
t.appendChild(document.createTextNode(" "));
t.appendChild(np);
t.appendChild(document.createTextNode(" "));
t.appendChild(lp);
}

...全文
24 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
csgdseed 2009-02-04
  • 打赏
  • 举报
回复
帮顶

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧