|
-
Aug 7th, 2003, 12:11 AM
#1
Thread Starter
Frenzied Member
XPath - Resolved.
Right, I'm building a calendar selection. The month & year are known.
Now, assuming I have an XML structure like this (from Sql Server):
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>
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.
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.
Last edited by axion_sa; Aug 7th, 2003 at 01:07 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|