日期:2014-05-17 浏览次数:20481 次
<?xml version="1.0" encoding="utf-8"?> <ErrorInfo> <Error> <LOpertionID ID="20120827164554950"> <StudentID ID="84"> <LQuestionID ID="0"> <LDateID ID="0"> <LErrorReportingID ID="1"> <FErrorNumber ID="0" /> </LErrorReportingID> <LErrorReportingID ID="2"> <FErrorNumber ID="0" /> </LErrorReportingID> <LErrorReportingID ID="3"> <FErrorNumber ID="0" /> </LErrorReportingID> <LErrorReportingID ID="4"> <FErrorNumber ID="0" /> </LErrorReportingID> </LDateID> </LQuestionID> <LQuestionID ID="1"> <LDateID ID="30017"> <LErrorReportingID ID="1"> <FErrorNUmber ID="0" /> </LErrorReportingID> <LErrorReportingID ID="2"> <FErrorNUmber ID="0" /> </LErrorReportingID> <LErrorReportingID ID="3"> <FErrorNUmber ID="0" /> </LErrorReportingID> <LErrorReportingID ID="4"> <FErrorNUmber ID="0" /> </LErrorReportingID> </LDateID> </LQuestionID> </StudentID> </LOpertionID> </Error> </ErrorInfo>
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Repeater rep1 = e.Item.FindControl("repnumber1") as Repeater;//找到里层的repeater对象 Repeater rep2 = e.Item.FindControl("repnumber2") as Repeater; Repeater rep3 = e.Item.FindControl("repnumber3") as Repeater; Repeater rep4 = e.Item.FindControl("repnumber4") as Repeater; //DataRowView rowv = (DataRowView)e.Item.DataItem;//找到分类Repeater关联的数据项 //int typeid = Convert.ToInt32(rowv["FID"]); //获取填充子类的id XmlDocument xml = new XmlDocument(); string url = Server.MapPath("Xml\\20120827164554950.xml"); xml.Load(url); XmlNode root = xml.SelectSingleNode("ErrorInfo/Error"); XmlNodeList nodelist = xml.SelectSingleNode("ErrorInfo/Error/LOpertionID/StudentID").ChildNodes; foreach (XmlNode xn1 in nodelist) { XmlElement xe1 = (XmlElement)xn1; if (xe1.GetAttribute("ID") == lid.ToString()) { XmlNodeList lis = xe1.ChildNodes; foreach (XmlNode xn2 in lis) { XmlElement xe2 = (XmlElement)xn2; if (xe2.GetAttribute("ID") == "30016") { XmlNodeList list = xe2.ChildNodes; foreach (XmlNode xn in list) {