[RESOLVED] Working with XML Doc
I have an xml doc ument which looks like below
I want to edit its content so that instead of the description list items being in xml nodes it is all one string within the prerequisites node containing html and list ul/li items.
Quote:
- <prerequisites>
- <descriptions>
<description>Object-oriented programming</description>
<description>SQL</description>
<description>C#</description>
<description>Relational Database Concepts</description>
<description>.Net Application Development</description>
</descriptions>
</prerequisites>
I think to achieve this I need to delete the descriptions node where the parent is prerequisites and replace each description node with <li>
I am no clear how to do this.
Code:
XmlDocument d = new XmlDocument();
d.Load(Outline_xml.ToString());
XmlNode root = d.DocumentElement;
XmlNodeList projectNodes = root.SelectNodes("descendant::descriptions[description]");
for (int i = 0; i < projectNodes.Count; i++)
{
//if (projectNodes[i].ParentNode.Name == "descriptions")
//{
projectNodes[i].ParentNode.RemoveChild(projectNodes[i]);
//}
}
d.Save(Outline_xml.ToString());