Roy Osherove

View Original

Generate an object model from an XML string

Tommy sent me an email:

"I've written a little web application that could come in handy for your many projects. It generates the C# code needed to read and write the given xml (Just past some xml in the textbox). You can find it @ http://xgeneration.tuyware.com/
It's candidate for a lot of improvements, but it's already usefull.
Enjoy it !"

I tried it out with an RSS feed and it generated classes for all the elements in the feed, with the root element being the one you'd start from, calling root.ReadXML().

Very nice! I can see how this could be useful in many scenarios, but be sure not to paste in anything secure, since this is a web application!