有想查看xml结尾源文件,出现了问题,看不了?
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);
}