I have xml file. This is just piece of that file
1 <mainTerm>
2 <title> Abandonment </title>
3 <see> Maltreatment </see>
4 </mainTerm>
5 <mainTerm>
6 <title> Abasia <nemod>(-astasia) (hysterical) </nemod></title>
7 <code>F44.4</code>
8 </mainTerm>
I have a lot of <mainTerm>
and i loop through all of them. I copy all data of elements, but when i reach line 6, i got the problem. How to copy all that content? I need get at the end string, that will looks like "Abasia (-astasia) (hysterical)".
That's the piece of my app that work with that file
List<string> nodes = new List<string>();
//Create XmlReaderSettings object
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreWhitespace = true;
settings.IgnoreComments = true;
//Create XmlReader object
XmlReader xmlIn = XmlReader.Create(path, settings);
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Add(misValue);
if (xmlIn.ReadToDescendant("mainTerm"))
{
do
{
xmlIn.ReadStartElement("mainTerm");
nodes.Add(xmlIn.ReadElementContentAsString());
nodes.Add(xmlIn.ReadElementContentAsString());
} while (xmlIn.ReadToNextSibling("mainTerm"));
}