I am reading xml from xxx URl but i am getting error as Root element is missing.
My code to read xml response is as follows:
XmlDocument doc = new XmlDocument();
doc.Load("URL from which i am reading xml");
XmlNodeList nodes = doc.GetElementsByTagName("Product");
XmlNode node = null;
foreach (XmlNode n in nodes)
{
}
and the xml response is as follows:
<All_Products>
<Product>
<ProductCode>GFT</ProductCode>
<ProductName>Gift Certificate</ProductName>
<ProductDescriptionShort>Give the perfect gift. </ProductDescriptionShort>
<ProductDescription>Give the perfect gift.</ProductDescription>
<ProductNameShort>Gift Certificate</ProductNameShort>
<FreeShippingItem>Y</FreeShippingItem>
<ProductPrice>55.0000</ProductPrice>
<TaxableProduct>Y</TaxableProduct>
</Product>
</All_Products>
Can you please tell where i am going wrong.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…