Xml Reader Read Tags

gotyourg

New Member
I have to read xml file. I did it but i had a problem.I have xml like this\[code\] <?xml version="1.0" encoding="windows-1254" ?> - <Xm>- <Products> <Product_No>NT-7</Product_No> <Stok>1</Stok> <Product_Details>something</Product_Details> <Desi>0,2</Desi> - <Variant> <VariantAd>size</VariantAd> <Options>68 cm</Options> </Variant> </Products>- <Products> <Product_No>NT-15</Product_No> <Stok>1</Stok> <Product_Details>something</Product_Details> <Desi>0,2</Desi> - <Variant> <VariantAd>size</VariantAd> <Options>68 cm</Options> <Options>74 cm</Options> </Variant> </Products> </Xm>\[/code\]I can read everyting, but my problem is i cant seperate options.\[code\] <Options>68 cm</Options> <Options>74 cm</Options> \[/code\]I cant read it together. I need to read it together and join them as string.\[code\]System.Xml.XmlNodeList lst = root.GetElementsByTagName("Product_No");foreach (System.Xml.XmlNode n in lst){ Product_No.Add(n.InnerText);}lst = root.GetElementsByTagName("Stok");foreach (System.Xml.XmlNode n in lst){ Stok.Add(n.InnerText);}lst = root.GetElementsByTagName("Product_Details");foreach (System.Xml.XmlNode n in lst){ Product_Details.Add(n.InnerText);}lst = root.GetElementsByTagName("Options");foreach (System.Xml.XmlNode n in lst){ Options.Add(n.InnerText);}\[/code\]How can i read and join them ?
 
Back
Top