public void process_xml(String name) { try { XmlDocument doc = new XmlDocument(); String fname = name; doc.Load(fname); XmlNodeList nList1; XmlNodeList nList2; XmlNodeList nList; nList=doc.GetElementsByTagName("EmpDataSet"); for( int m =0;m<nList.Count;m++) { XmlElement element_main = (XmlElement)nList.Item(m);//emp_table nList1 = element_main.ChildNodes ;//Emps for( int k =0;k<nList1.Count;k++) { XmlElement element_fchild = (XmlElement)nList1.Item(k); nList2 = element_fchild.ChildNodes ; IEmpDetails emp = new EmpDetails(); if( m_bAbort) { return; } for( int j =0;j<nList2.Count;j++) { XmlElement child_element = (XmlElement)nList2.Item(j); if( child_element.Name == "Emp_id" ) { emp.empId = System.Convert.ToInt32(child_element.InnerText); } if( child_element.Name == "Emp_Name" ) { emp.empName = child_element.InnerText; } if( child_element.Name == "Emp_Address" ) { emp.empAddress = child_element.InnerText; } |