I have the following xml file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<termsAndConditions>
<logo>
logo1.gif
</logo>
<link>
https://www.mysite.co.uk/Terms%20and%20Conditions.pdf
</link>
<paragraphs>
<text>
I accept that all the information I have provided is truthful and accurate and I understand that all the information I have provided will be checked and verified. I acknowledge that I have read and accepted all the Terms and Conditions of the site’s Parking Regulations, for full details click here.
</text>
<text>
Paragraph 2
</text>
<text>
Paragraph 3
</text>
<text>
Paragraph 4
</text>
</paragraphs>
</termsAndConditions>
Now I can convert a node to a string using the following:
XmlDocument doc = new XmlDocument();
doc.Load("\\termConditionsExample.xml");
XmlNode node = doc.DocumentElement.SelectSingleNode("/termsAndConditions/logo");
string myString = node.InnerText;
But how can I do this for the "paragraphs/text" in the xml file to turn them into a List type? I have tried using the different DocumentElement mwthods such as one below, but it does not work:
List<string> paragraphs = new List<string>();
foreach(var temp in doc.DocumentElement.ChildNodes)
{
paragraphs.Add(temp.ToString());
}
I know this one does not take any arguments so is wrong. I just don't know which one to use...