I have an XSD and would like to serialise it into a C# class. My current process is
Go to https://www.liquid-technologies.com/online-xsd-to-xml-converter
to convert the XSD to XML and then convert this XML to a C# class using https://xmltocsharp.azurewebsites.net/
This works but occasionally i get the error "Unexpected node type Element" or similar errors (Unexpected node type Element. ReadElementString method can only be called on elements with simple or empty content)If i get the XML of the record i get the error from, i re-run the above process to generate the C# class again then other records return an error.
So i checked another site to see if the "non working" XML validates against the XSD - it does!
To me it seems the above URLs may not be generating the C# classes correctly. Is there another way to generate these classes? OR how should i modify the class manually, so that it meets whichever record it loads?