EDN Admin
Well-known member
Hi;
Given this xml file format:
<span style="font-size:small <span style="font-size:small
<pre class="prettyprint // <Content>
// <Contents>
// <Data>
// <FORMINFO>
// <APPRAISER>
// <EMAIL></EMAIL>
// <SIGNED>
// <DATE>05/27/2011</DATE>
// </SIGNED>
// <STATECERT>
// <NUM>111122223333</NUM>
// <STATEPROV>GA</STATEPROV>
// </STATECERT>
// <STATELIC>
// <NUM>444555666</NUM>
// </STATELIC>
// <OTHER>
// <NUM>GA</NUM>
// </OTHER>
// <LICCERTEXP>
// <DATE>05/05/2019</DATE>
// </LICCERTEXP>
//</APPRAISER>
//<SUPAPPRAISER>
// <INSPECTION>
// <SUBJECTPROP>DID2</SUBJECTPROP>
// <SUBJECTINTERIOREXTERIOR>
// <DATE>05/25/2011</DATE>
// </SUBJECTINTERIOREXTERIOR>
// <COMPSALES>DID</COMPSALES>
// <COMPINTERIOREXTERIOR>
// <DATE>05/26/2011</DATE>
// </COMPINTERIOREXTERIOR>
// </INSPECTION>
//</SUPAPPRAISER>[/code]
I am trying to query the elements appraiser/statecert/num and the supappraiser/subjectinterioeexterior/date
using this Linq query but I am getting a blank console window.
<pre class="prettyprint var results = from forminfo in XDocument.Load
("c:/DatFeedBack2.xml").Root.Elements("forminfo")
from appraiser in forminfo.Elements("appraiser")
from statecert in appraiser.Elements("statecert")
from num in statecert.Elements("num")
select new {Item = ((string)forminfo.Element("Num"))};
foreach(var result in results)
{
Console.WriteLine("Here is the value: ",
result.Item);
}
//Console.WriteLine(result);
Console.ReadLine();[/code]
Can anyone see where my query is wrong ?
Thanks for your insights !
<hr class="sig GeeMann
View the full article
Given this xml file format:
<span style="font-size:small <span style="font-size:small
<pre class="prettyprint // <Content>
// <Contents>
// <Data>
// <FORMINFO>
// <APPRAISER>
// <EMAIL></EMAIL>
// <SIGNED>
// <DATE>05/27/2011</DATE>
// </SIGNED>
// <STATECERT>
// <NUM>111122223333</NUM>
// <STATEPROV>GA</STATEPROV>
// </STATECERT>
// <STATELIC>
// <NUM>444555666</NUM>
// </STATELIC>
// <OTHER>
// <NUM>GA</NUM>
// </OTHER>
// <LICCERTEXP>
// <DATE>05/05/2019</DATE>
// </LICCERTEXP>
//</APPRAISER>
//<SUPAPPRAISER>
// <INSPECTION>
// <SUBJECTPROP>DID2</SUBJECTPROP>
// <SUBJECTINTERIOREXTERIOR>
// <DATE>05/25/2011</DATE>
// </SUBJECTINTERIOREXTERIOR>
// <COMPSALES>DID</COMPSALES>
// <COMPINTERIOREXTERIOR>
// <DATE>05/26/2011</DATE>
// </COMPINTERIOREXTERIOR>
// </INSPECTION>
//</SUPAPPRAISER>[/code]
I am trying to query the elements appraiser/statecert/num and the supappraiser/subjectinterioeexterior/date
using this Linq query but I am getting a blank console window.
<pre class="prettyprint var results = from forminfo in XDocument.Load
("c:/DatFeedBack2.xml").Root.Elements("forminfo")
from appraiser in forminfo.Elements("appraiser")
from statecert in appraiser.Elements("statecert")
from num in statecert.Elements("num")
select new {Item = ((string)forminfo.Element("Num"))};
foreach(var result in results)
{
Console.WriteLine("Here is the value: ",
result.Item);
}
//Console.WriteLine(result);
Console.ReadLine();[/code]
Can anyone see where my query is wrong ?
Thanks for your insights !
<hr class="sig GeeMann
View the full article