Hello All:
I am working on parsing the Amazon Key word search webservice for the
Editorial Reviews Content containing "Amazon.Com Review" in the Source
element.
<EditorialRevie ws>
<EditorialRevie w>
<Source>Produ ct Description</Source>
<ContentProd desc ........</Content>
</EditorialReview >
<EditorialRevie w>
<Source>Amazon. com Review</Source>
<ContentAMZN Review desc *** This Text *****</Content /
</EditorialReview >
</EditorialReview s>
//Call to Parse Editorial Reviews Nodes
Notes = ParseNotes(resu lt.Descendants( ns + "EditorialRevie ws")),
//Parse Editorial Reviews
private string ParseNotes(IEnu merable<XElemen tnotesElement)
{
var productDescript ion = (from notes in
notesElement.De scendants(ns + "EditorialRevie w")
let source = (string) notes.Element(n s
+ "Source")
where source == "Amazon.com Review"
select new
{
Source = (string)
notes.Element(n s + "Source"),
Content = (string)
notes.Element(n s + "Content")
});
foreach (var s in productDescript ion)
{
Response.Write( s.Content + "<hr/>");
}
When I loop through the results, the Content that I am looking for is
repeated 2x, how do I write the query so the correct results are only
displayed 1x.
Thanks
Stuart
I am working on parsing the Amazon Key word search webservice for the
Editorial Reviews Content containing "Amazon.Com Review" in the Source
element.
<EditorialRevie ws>
<EditorialRevie w>
<Source>Produ ct Description</Source>
<ContentProd desc ........</Content>
</EditorialReview >
<EditorialRevie w>
<Source>Amazon. com Review</Source>
<ContentAMZN Review desc *** This Text *****</Content /
</EditorialReview >
</EditorialReview s>
//Call to Parse Editorial Reviews Nodes
Notes = ParseNotes(resu lt.Descendants( ns + "EditorialRevie ws")),
//Parse Editorial Reviews
private string ParseNotes(IEnu merable<XElemen tnotesElement)
{
var productDescript ion = (from notes in
notesElement.De scendants(ns + "EditorialRevie w")
let source = (string) notes.Element(n s
+ "Source")
where source == "Amazon.com Review"
select new
{
Source = (string)
notes.Element(n s + "Source"),
Content = (string)
notes.Element(n s + "Content")
});
foreach (var s in productDescript ion)
{
Response.Write( s.Content + "<hr/>");
}
When I loop through the results, the Content that I am looking for is
repeated 2x, how do I write the query so the correct results are only
displayed 1x.
Thanks
Stuart
Comment