Best way to consume xml feed in asp.net MVC (c#)

TheDon

New Member
I have an MVC website that, when you click a button, will use Get method to grab xml data from another website. I need to then display part of this XML in my webpage.My current approach is to deserialize the XML into objects, and pass the objects into the View, which will then grab the appropriate data.My problem is that my classes don't match the XML data entirely (it doesn't have every element/attribute/etc). The data is too long, with too many elements and attributes, so I don't want to write everything to the classes. And I couldn't create classes from the XML data using XSD.exe because of some error in the data (though the xml data works fine when my webpage is reading it).Is there a more efficient way of doing this?Read in this link that IXmlSerializable might be away, although the comments also noted some problems with it. And it seems like it might be quite complicated.How to deserialize only part of an XML document in C#Your help is much appreciated. Thanks!
 
Back
Top