this is my method
private void ParseXML()
{
int pubid = 1;
settings.DtdProcessing = DtdProcessing.Parse;
using (reader = XmlReader.Create(FileName, settings))
{
while (reader.Read())
{
if (reader.IsStartElement())
{
switch (reader.Name.Trim().ToLower())
{
case "book":
book = new Book();
book.Pubid = pubid;
book.Pubtype = "book";
book.Pubkey = reader.GetAttribute("key");
ParseBook(reader, book);
pubid++;
break;
case "article":
article = new Article();
article.Pubid = pubid;
article.Pubkey = reader.GetAttribute("key");
article.Pubtype = "article";
ParseArticle(reader, article);
pubid++;
break;
case "incollection":
incollection = new Incollection();
incollection.Pubid = pubid;
incollection.Pubkey = reader.GetAttribute("key");
ParseIncollection(reader, incollection);
pubid++;
break;
case "inproceedings":
inproceeding = new Inproceedings();
inproceeding.Pubid = pubid;
inproceeding.Pubtype = "inproceeding";
inproceeding.Pubkey = reader.GetAttribute("key");
ParseInproceedings(reader, inproceeding);
pubid++;
break;
}
}
}
}
}
I am parsing this file. http://dblp.uni-trier.de/xml/
However, i have checked the xml with other parsers and it seems the incollections element is in the xml.
However, when i run this piece of code, my case "incollection" is not fired. Others works fine.
This is the xml file which is 1.2Gb.
Debugging does not even hit the in collection = new incollection so there is no error