My guess is this will allow you to ignore certain errors. If an exception is
thrown, you can't validate the rest of the document. Just a guess.
On a side note, I'm having trouble getting the XmlValidatingReader to work.
I've created both an xml & xsd file, and they pass validation through xml
spy. However, when I run it through the XmlValidatingReader I'm getting the
errors
'Could not find schema information for the element <myElement>'
and
'Could not find schema information for the attribute <myAttribute>'
also
'The attribute targetNamespace does not match the designated namespace URI'
for every element & attribute in the document.
why would it validate for one and not the other?
thanks,
jason
"AP" <ad***@indra.com> wrote in message
news:<ex*************@tk2msftngp13.phx.gbl>...
Hello,
I'm trying to use .NET to validate incoming XML documents against the
appropriate schema in our database. I do not want to use the document's
schemaLocation attribute to validate for various reasons, but rather check
against a schema that I pull from a database and add to the reader's
schema
collection. I am curious as to why the XmlValidatingReader fires an event
when the document is invalid, rather than throwing an exception? This
makes
developing a method to do this a lot harder. Is there some reason it has
been implemented this way?
Thanks,
Adam