XML Schema Validation using DOM

  • Thread starter Thread starter kurotsuke
  • Start date Start date
K

kurotsuke

I'm using DOM to read an XML file. How can I do validation without
reading the xml file twice?
Thanks.
 
kurotsuke said:
I'm using DOM to read an XML file. How can I do validation without
reading the xml file twice?

Well, XmlDocument has a method Load which allows to pass in an XmlReader
and as XmlValidatingReader is a subclass of XmlReader you simply need to
use that method and pass in an XmlValidatingReader.
 
Back
Top