Is the "parse" method generated from it validates the XML against the XSD ?

Jan 22, 2011 at 11:00 AM

I do want to validate the XML against the XSD how can I do that from the LINQ to XSD generated classes ?

Mar 1, 2011 at 11:44 AM

I'm also struggling with this one.

One problem I'm finding it that there is no built in XSD validation and further more, with an XSD set to LinqToXsdSchema in the properties, you cannot set it to embedded resource.

So the avenue of loading schemas out of the assembly for validation is out too.

My only current idea is a messy one.

Create a seperate project, add in all the XSD files as linked existing items (drop down the Open button when adding an existing item) and set THEM to embedded resource.

Then the primary assembly referenced the resource assembly and uses them to do validation.

Yuck! 8X

James.

Mar 2, 2011 at 7:18 AM

The XSD's are included as "Compile" using msbuild.targets. There is validation included at this moment, but this is only on "SET"-level of the properties. It would indeed be very nice if you could also just call ".Validate();" on the object so that it would validate against the XSD if the content is correct.