Answer the question
In order to leave comments, you need to log in
How to parse certain elements in an xml document?
I managed to find out the title of the book, but I can't get the series/cycle of books ( sequence name ).
My code:
XmlTextReader xtr = new XmlTextReader(@"C:\Users\Boss\Desktop\idiot.fb2");
while(xtr.Read())
{
if(xtr.NodeType == XmlNodeType.Element && xtr.Name == "book-name")
{
string s1 = xtr.ReadElementString();
Console.WriteLine("name = " + s1);
}
if (xtr.NodeType == XmlNodeType.Element && xtr.Name == "sequence name")
{
string s2 = xtr.ReadElementString();
Console.WriteLine("sequence name = " + s2);
}
<sequence name="Книга на все времена" number="0"/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question