we have to use some code for single root value, but we need multiple root elements and particular tag name to read data.
We have to read xml string with particular tag name. Please advise ASAP
Here is my code we have to use single root value its working fine,
string xmlString = "5/15/2018 test test Storyboarding ";
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlString);
XmlNodeList nodes = doc.DocumentElement.SelectNodes("//data");
StringBuilder yourString = new StringBuilder();
foreach (XmlNode node in nodes)
{
yourString.Append("Date:" + node["Date"].InnerText + "
");
");
yourString.Append("Course:" + node["Course"].InnerText + ",");
}
PlaceHolder1.Controls.Add(new LiteralControl(yourString.ToString()));
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal JadavPosted May 19, 2018, 1:34 AM