I am using XmlDocument() for parsing a file like **.opf ** for my application of EpubReader.
-
Following code loads and parses content.opf file without any error.
To iterate and compare above xml you may use following code:
try
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load("content.opf");
XmlNodeList items = xDoc.GetElementsByTagName("item");
foreach (XmlNode xItem in items)
{
string id = xItem.Attributes["id"].Value;
string href= xItem.Attributes["href"].Value;
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}