Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

get the value out of my XML

$
0
0

Hi all ,

I have a below XML structure, 


<Products>
        <Product>         
        <Item quality="good">GW001</Item>
                  <Item quality="bad">BW001</Item>
        <InStock>Yes</InStock>
          </Product>
         <Product>         
        <Item quality="good">GW002</Item>
                  <Item quality="bad">BW002</Item>
        <InStock>Yes</InStock>
          </Product>
        </Products>

and I have a below code to get the list of products out of the above xml 

   var products = xmlDocument.GetElementsByTagName("Product");
            foreach (XmlNode node in products)
            {

                  /////   

            }

and I wanted to populate my own list like below  ,  

myitems.Add(new ProductItem()  {good = "GW001",bad = "BW001",InStock ="Yes"});

myitems.Add(new ProductItem()  {good = "GW002",bad = "BW002",InStock ="Yes"});

could some one help me to get this ? 

thanks 


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>