Personally, I prefer the SAX model, since XmlReader has some really annoying traps that can cause errors in your code, which can cause your code to skip elements. Most of the code will be structured in about time (rdr.Read ()), but if you have any "ReadString" or "ReadInnerXml ()" in this loop, you will find that you skip the items in the next iteration.
Since SAX is an event, it will never evolve, since you cannot perform any operations that would make your parser look forward.
My personal opinion is that Microsoft came up with the idea that XmlReader better explains the push / pull model, but I really don't buy it. Therefore, Microsoft believes that you do not need to create a state machine with XmlReader, which for me does not make sense, but in any case, this is just my opinion.
Brett Ryan Aug 13 '09 at 10:31 2009-08-13 10:31
source share