0

I have a very big xml file. I read it using by xmlReader. I have problem when i reach to next line:

<title>Abasia<nemod>(-astasia) (hysterical)</nemod></title>

How I can read all that content. I have to have next string at the end: "Abasia (-astasia) (hysterical)".

I tried to use ReadElementContentAsString() for all elements, but elements like this has exception, because it has child element.

help, please=)

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Bryuk
  • 3,295
  • 10
  • 45
  • 74

1 Answers1

1

Could something like this work for you?

XmlNodeList itemNode = xmlDoc.SelectNodes("/");
XmlNode titleNode = itemNode.SelectSingleNode("title");
XmlNode nemodNode = itemNode.SelectSingleNode("nemod");
if((titleNode != null) && (dateNode != null))
    Console.WriteLine(titleNode.InnerText + " " + nemodNode.InnerText);
wizzkid
  • 187
  • 1
  • 3
  • 13