I'm working with C#, and I'm attempting to Deserialize an XML file into my application. This is a threaded process that pulls XML files from multiple directories, where each directory may have a specific schema based on our customers' needs.
What I'm trying to do is using a schema for a specific directory, and the deserializer I need to Load the data from the XML file into my object in my application. However, I need the deserializer to take the default values from the Schema if the element is not specified in the XML file.
I've found that there is a way to specify the schema location for a class using the [XmlSchemaProviderAttribute("GetSchemaFile")] attribute, and a static method (ref http://msdn.microsoft.com/en-us/magazine/cc300797.aspx). This however will not work for my current situation since I have multiple schemas specific to different files.
Does anyone know of a way to do this? Or should I attempt to find an alternate way of dealing with my need for defaults?