Remove nodes with date value older than today



In a C# application, if I have the following XML:



<SyncTable>
<SyncEntry>
<Cal_ID>1234</Cal_ID>
<Cal_LastUpdated>2015-01-20T14:25:34.828-05:00</Cal_LastUpdated>
<Cal_StartDateTime>2015-01-22T20:05:00-05:00</Cal_StartDateTime>
</SyncEntry>
<SyncEntry>
<Cal_ID>4567</Cal_ID>
<Cal_LastUpdated>2015-01-20T11:00:24.988-05:00</Cal_LastUpdated>
<Cal_StartDateTime>2015-02-10T18:30:00-05:00</Cal_StartDateTime>
</SyncEntry>
</SyncTable>


How can I search and delete the entries <SyncTable> where the <Cal_StartDateTime> entry is older than today?


No comments:

Post a Comment