Load XML file into object. Best method?

Posted by Cypher on Stack Overflow See other posts from Stack Overflow or by Cypher
Published on 2010-04-12T04:05:31Z Indexed on 2010/04/12 4:13 UTC
Read the original article Hit count: 219

Filed under:
|
|

Hello,

We are receiving an XML file from our client. I want to load the data from this file into a class, but am unsure about which way to go about it.

I have an XSD to defining what is expected in the XML file, so therefore i can easily validate the XML file.

Can i use the XSD file to load the data into a POCO, using some sort of serialization?

The other way i was thinking was to load the xml into a XMLDocument and use XPath to populate each property in my class.

Cheers for any advice

© Stack Overflow or respective owner

Related posts about xml-serialization

Related posts about POCO