Okey, this isn't your everyday XML question. What I want is; given a xml file - generate some kind of CIL code and instantiate a object of that class and then populate it (deserialize).
I don't want to use a xsd schema and I need to do everything runtime.
Any suggestions, I know how to create a .cs file during runtime. But is that the only way? Then I have to compile it runtime as well. Is that even recommended ?
Might annoy some people but I want to have it as easy as possible. The xml object will populate a data form of some kind, if you want to know.
Love any input!
I can't think of any problem where this kind of convulted object serialisation would be a solution.
If you can you provide further details of the original problem I'm sure we forum go-ers can come up with a better solution.
You could write the object when you compile your application, import the XML using a normal XML reader, populate an instance of the object and then write out the entire object using a binary write?
The benefit of this method is that you can keep your XML import code outside of the object you would store making it smaller. The drawbacks are that it is a horrible design and binary writes are the devil.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.