I have the following xml file that I need to read into my C# project so that I have a collection together with access to the attributes. I've tried several attempts although I'm not getting very far. I would like to use classes to represent the xml which I've seen before but cannot replicate. I don't want to read the file into a streamreader and then pull out the values. The previous project I think used the [Serializable] attribute on a class.
Hope this helps? Let me know if you need more, I'm using C# 4.0.
Thanks, James
<MyProducts xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<MyProduct MyProductCode="MBB" MyProductCategory="Computer" MyProductMaxNumber = "4">
<MyProductLookups>
<MyProductLookup Lang="AAA">Test 1</MyProductLookup>
<MyProductLookup Lang="BBB">Test 2</MyProductLookup>
<MyProductLookup Lang="CCC">Test 3</MyProductLookup>
<MyProductLookup Lang="DDD">Test 4</MyProductLookup>
</MyProductLookups>
</MyProduct>
<MyProduct MyProductCode="LJJ" MyProductCategory="Laptop" MyProductMaxNumber = "4">
<MyProductLookups>
<MyProductLookup Lang="AAA">Test 5</MyProductLookup>
<MyProductLookup Lang="BBB">Test 6</MyProductLookup>
<MyProductLookup Lang="CCC">Test 7</MyProductLookup>
<MyProductLookup Lang="DDD">Test 8</MyProductLookup>
</MyProductLookups>
</MyProduct>