Right, I'm building a calendar selection. The month & year are known.
Now, assuming I have an XML structure like this (from Sql Server):
So, with a loop through the days of the month, I've got the date (time can be ignored). Now what I've got to do, is check if the date falls within a date range.Code:<root>
<item>
<startdate>2003-08-01T16:00:00</startdate>
<enddate>2003-08-03T16:30:00</enddate>
<caption>Blah</caption>
<url>www.blah.com</url>
<color>navy</color>
</item>
<item>
<startdate>2003-08-01T10:00:00</startdate>
<enddate>2003-08-07T11:30:00</enddate>
<caption>Blah Again</caption>
<url>www.blah.com</url>
<color>silver</color>
</item>
</root>
For example, in the above XML, lets say the date is 20030802. It falls between the start and end dates of both items. Now, I need the colors for both of these items. If the date was 20030804, only the second item's color is required.
The problem I'm having is that I can't figure out how to use two child nodes in one predicate, using the substring function. This is all being done in C#, btw, and looping through each node in the Xml document & manually checking is easy enough, but why write all that code if you can get it with one XPath query? :)
Thanks,
Brian
[Edit] Dates were in the wrong format.
