I have an System.IO.Stream object that may or may not be XML.
What is the quickest/easiest way to determine if
1) Is this file XML and
2) if it is, then is it an instance of a particular schema?
In the end I really just trying to write a method that can return true or false if a particular Stream is an instance of a schema.
Thanks for the help!
I suggest you try to load is an
XDocument, and then useXDocument.Validate. Return false if either the parsing or validation fails. There’s some sample code on MSDN which does something pretty similar, and which would be a good starting point.