how to read xmlnode and inner ChildNodes and update from input type text?

lio

New Member
I have an xml file like this...\[code\]<AnimationPackage><condition><name>Some Condition 0</name><url>http://www.google.com.pk</url><rehab> <name>Some rehab 0</name> <url>http://www.youtube.com</url></rehab><rehab> <name>Some rehab 1</name> <url>http://www.youtube.com</url></rehab><rehab> <name>Some rehab 2</name> <url>http://www.youtube.com</url></rehab></condition><condition><name>Some Condition 1</name><url>http://www.google.com.pk</url><rehab> <name>Some rehab 0</name> <url>http://www.youtube.com</url></rehab><rehab> <name>Some rehab 1</name> <url>http://www.youtube.com</url></rehab>\[/code\]how to count the tags name also like Atfirst \[code\]<Conditions>\[/code\] then \[code\]<rehab>\[/code\] For that condtionsand then inner text from the \[code\]<rehab>\[/code\] tags from \[code\]<name>\[/code\] and \[code\]<url>\[/code\] tag.I tried this but after first read its not working.. any help plz.\[code\]XmlDocument readDoc = new XmlDocument();readDoc.Load(MapPath("JkGroups.xml"));conditions = readDoc.SelectNodes("AnimationPackage/condition").Count;rehab = readDoc.SelectNodes("AnimationPackage/condition/rehab").Count;lblApptitle.Text = dt.Rows[0]["packageName"].ToString();XmlNodeList nodeListName = readDoc.SelectNodes("AnimationPackage/condition/rehab/name");XmlNodeList nodeListUrl = readDoc.SelectNodes("AnimationPackage/condition/rehab/url");for (rehabCount = 0; rehabCount < rehab; rehabCount++){ rehabNodeName = nodeListName[0].ChildNodes[rehabCount].InnerText; rehabNodeUrl = nodeListUrl[0].ChildNodes[rehabCount].InnerText; rehabtr += "<tr><td style='width: 106px;padding-left: 20px;' >Rehab title</td><td>" + "<input type='text' value='" + rehabNodeName + "' id='txtRehabSupportTitle" + rehabCount + "' runat='server' /></td><td>" + "<input type='text' value='" + rehabNodeUrl + "' id='txtRehabSupportURL" + rehabCount + "' runat='server' /></td></tr>";}string rehabBody = "<table id='tblRehab'>" + rehabtr + "<tr><td></td><td></td><td><p>Type support product buy URL</p></td></tr><tr>" + "<td><td>&nbsp;</td><td>&nbsp;</td></tr></table>";\[/code\]there is some thing code missing but I just want to help in xml..
 
Back
Top