I've used XSD2Code to create a set of C# classes representing an XML document I'm currently retrieving from a web service call.
The returned object of the web service call is of type XMLNode.
I want to create an object from the generated classes and then populate it from the XMLNode.
The outter most class that seems to be have been generated is NewDataSet.
I'm a little stuck as to how to create/populate that object. Do I need to use Deserialization?
The way I ended up resolving this was as follows.
I used the project Linq to XSD Project: http://linqtoxsd.codeplex.com/
Using the XSD I created a new set of C# Classes From the command prompt
I then imported this C# file into my code.
I had to add a reference to the Xml.Scheme.Linq library I could then create a populated set of objects:
and use Linq to access typed XML as follows:
and so forth!