If I have a large (>500MB) XML file to validate, does an XmlReader bring the whole thing into memory to perform validation?
I looked at Validating an XML against referenced XSD in C# for validation procedure.
thanks, Mark
No, if you use XmlValidatingReader
(or XmlReader
with appropriate settings) it won't load the whole XML file. The method described in the question uses XmlDocument
class which does load the whole file. The accepted answer doesn't load the entire file so you'll be fine using it.