Need help with using Linq with XDocument ?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi;
I am trying to use this statement to display an XML element and its value -
IEnumerable<XElement> elements = xDocument.Desendants ("Appraiser");
foreach (XElement element in elements)
{
Console.WriteLine("Element: {0} : Value = {1}",
element.Name, element.Value);
}
Here is the xml file contents :

<pre class="prettyprint <APPRAISER>
<EMAIL>test@testing.com</EMAIL>
<SIGNED>
<DATE>05/27/2011</DATE>
</SIGNED>
<STATECERT>
<NUM>111122223333</NUM>
<STATEPROV>GA</STATEPROV>
</STATECERT>[/code]
The console returns nothing ?
Thanks for your insights <hr class="sig GeeMann

View the full article
 
Back
Top