S
Stuart Shay
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.
<EditorialReviews>
<EditorialReview>
<Source>Product Description</Source>
<Content> Prod desc ........</Content>
</EditorialReview>
<EditorialReview>
<Source>Amazon.com Review</Source>
<Content> AMZN Review desc *** This Text *****</Content> /
</EditorialReview>
</EditorialReviews>
//Call to Parse Editorial Reviews Nodes
Notes = ParseNotes(result.Descendants(ns + "EditorialReviews")),
//Parse Editorial Reviews
private string ParseNotes(IEnumerable<XElement> notesElement)
{
var productDescription = (from notes in
notesElement.Descendants(ns + "EditorialReview")
let source = (string) notes.Element(ns
+ "Source")
where source == "Amazon.com Review"
select new
{
Source = (string)
notes.Element(ns + "Source"),
Content = (string)
notes.Element(ns + "Content")
});
foreach (var s in productDescription)
{
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.
<EditorialReviews>
<EditorialReview>
<Source>Product Description</Source>
<Content> Prod desc ........</Content>
</EditorialReview>
<EditorialReview>
<Source>Amazon.com Review</Source>
<Content> AMZN Review desc *** This Text *****</Content> /
</EditorialReview>
</EditorialReviews>
//Call to Parse Editorial Reviews Nodes
Notes = ParseNotes(result.Descendants(ns + "EditorialReviews")),
//Parse Editorial Reviews
private string ParseNotes(IEnumerable<XElement> notesElement)
{
var productDescription = (from notes in
notesElement.Descendants(ns + "EditorialReview")
let source = (string) notes.Element(ns
+ "Source")
where source == "Amazon.com Review"
select new
{
Source = (string)
notes.Element(ns + "Source"),
Content = (string)
notes.Element(ns + "Content")
});
foreach (var s in productDescription)
{
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