parsing fb2 book as xml

405 Views Asked by At

I want to write a fb2 book parser. I am trying to parse it like xml in this way:

XmlDocument doc = new XmlDocument();
doc.Load("file name");

foreach(XmlNode item in doc.DocumentElement.ChildNodes)
{
    using(StreamWriter sw=new StreamWriter("text.txt"))
    {
        sw.WriteLine(item.InnerText);
    }
}

But I'm getting unreadable set of letters. Also I have a question: If the book contains an image, how should I get it correctly?

0

There are 0 best solutions below