I tried to read a XML file but I don't receive content of nodes that have just space or tab or new line. Please tell me where I'm wrong.
The XML file:
<?xml version="1.0" encoding="UTF-8"?> <root> <paragraph> <sentence> <sequence> <word>aaa</word> <space> </space> </sequence> <sequence> <word>bbb</word> <space> </space> </sequence> <sequence> <word>ccc</word> <space>?!</space> </sequence> </sentence> </paragraph> </root> The code:
XmlDocument doc = new XmlDocument(); doc.Load("D:/Licenta/files/struct.xml"); XmlNodeList sentences = doc.DocumentElement.SelectNodes("/root/paragraph"); foreach (XmlNode sentence in sentences) { Console.WriteLine(sentence.InnerText); } Console.ReadLine(); The output: aaabbbccc?!