I have to read an XML file, that has no root element, to extract contained data. The XML has many elements like these:
I found a way to solve my problem, I gave up to read it as an XML and I read it as a StreamReader, looking for the text I want to read, so I don't have to fight against the XML format
using (StreamReader strReader = File.OpenText(path))
{
while (!strReader.EndOfStream)
{
string line = strReader.ReadLine();
if (line.Contains("")) {
line = strReader.ReadLine();
string data_ = getTagText(line);
string channelName_ = getTagText( strReader.ReadLine());
string sql_ = getTagText( strReader.ReadLine());
string idHotel_ = getTagText(strReader.ReadLine());
string type_ = getTagText(strReader.ReadLine());
}
}
}