Linq to XSD validates elements but not structure

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a schema which I have generate objects using Linq to XSD.
When loading xml I use the generated load method. If elements are there and invalid then I get an exception.

However if the element is missing (and the XSD stipulates that the element must exist) no error is generated. The object model simply contains NULL for this entry.
Why does the load method not validate the structure?
Thanks
Ian

View the full article
 
Back
Top