Basically I have an xml document and i want to retrieve some data based on the release date.
For example, lets assume i have the following xml
<books>
<book>
<name>Book 1<name>
<release_date>2011-11-10</release_date>
</book>
<book>
<name>Book 2<name>
<release_date>2012-03-16</release_date>
</book>
<book>
<name>Book 3<name>
<release_date>2010-01-22</release_date>
</book>
<book>
<name>Book 4<name>
<release_date>2011-12-22</release_date>
</book>
</books>
So what i want to have is following for example i pass a date 11/15/2011, and only all documents which were released later should be returned? Any idea how to achieve that?
Is it something like that?:
var returnedEl = from XElement e in doc.Root.Elements where e.Element("release_date")> passedDate select e;
O what would be a another working and best approach?
Yes, you are very close to the solution