Hi
How to retrieve the "SampleName","1234","07-07
-1977" from the below xml document. I tried loading that into xmldocument and loop but realized that is not efficient as the actual document has many elements.
<?xml version="1.0" encoding="utf-8" ?>
<fC xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns="
http://www.test.com">
- <fF>
- <f d:name="a1" xmlns:d="
http://www.test.com">
<d:text>Medha</d:text>
<d:restriction>REQUIRED</d
:restricti
on>
</f>
- <f d:name="a2" xmlns:d="
http://www.test.com">
<d:text>11111</d:text>
<d:restriction>REQUIRED</d
:restricti
on>
</f>
- <f d:name="a3" xmlns:d="
http://www.test.com">
<d:date>07-07-1999</d:date
>
<d:restriction>REQUIRED</d
:restricti
on>
</f>
</fF>
</fC>
Please suggest any resources or sample code.
Thank You
foreach (XmlNode xn in xnList)
{
string myText = xn["d:text"].InnerText;
Console.WriteLine("My Text: {0}", myText);
}
Can you try this!
Thanks!