Xdocument validate not validating
I wrote a method to validate and xml file against a schema. If the file does not conform to the schema, it throws an error. If I try to validate an XDocument (containing schema xml) against a schema url, it validates successfully..... I'm using LINQ to XML and trying to validate an XDocument object against an XSD.
If you use Xml Reader for validation you can use Xml Reader Settings with warnings enabled and you will get a warning emitted to your validation event handler.In .net, you can create a validating XML Reader by passing in Xml Reader Settings into Xml Reader.Create, but the built-in Validation Type is limited to W3C XML Schema (.xsd) or Document type definitions (.dtd).I have a project I’m working on that requires the use of some extensive XML manipulation.While XML can be very powerful, XML without a schema is like Java Script objects: no strong typing and the wild west as far as standards are concerned.