Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:07:56+00:00 2026-06-16T00:07:56+00:00

Basically I have an xml document and i want to retrieve some data based

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:07:57+00:00Added an answer on June 16, 2026 at 12:07 am

    Yes, you are very close to the solution

    var xDoc = XDocument.Load("aa.xml");
    DateTime passedDate  = new DateTime(2010,11,11);
    
    var books = xDoc.Descendants("book")
                  .Where(b=>DateTime.ParseExact(b.Element("release_date").Value,"yyyy-MM-dd",CultureInfo.InvariantCulture)>passedDate)
                  .ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XDocument class with the XML contents already made. I basically want
Let's say we have the following XML document: <root> <options> ... </options> <children> <child
I have an XML file whose contents I want to sort by document order
I am parsing an XML (RDF specifically) document, basically mapping it to some strongly
I have an XML document (generated by Adobe XFA forms), that contains data like
I have the following XML Document being loaded into C# Silverlight: <parent> <son name=Jim>
I have an XML document with (basically) looks like this: ... <param> <key>age</key> <value>10</value>
I have a simple xml document that looks like the following snippet. I need
I have a bit of code that basically reads an XML document using the
Basically I have an xml feed from an offsite server. The xml feed has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.