Search the web
Sign In
New User? Sign Up
xrules · XRules & DynamicDOM
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How to do sibling checks? non-string compares?   Message List  
Reply | Forward Message #39 of 74 |
Imagine a truck delivery schedule. Suppose xml is:

...
<schedule>
<leg>
<depart>08:00</depart>
</leg>
<leg>
<arrive>08:45</arrive>
<depart>10:00</depart>
</leg>
<leg>
<arrive>11:45</arrive>
<depart>13:00</depart>
</leg>
<leg>
<arrive>13:45</arrive>
</leg>
</schedule>
...

Rule: Within a leg, departures occur after arrivals, if there are
arrivals and departures. I see how to validate that, so long as a
string compare works. Something like: <xr:validate test="depart >
arrive" /> I'm not sure how the missing arrival or departure affects
that.

Rule: For any leg, the arrival is after the previous leg's departue.

Rule: For the first leg, there is no arrival.

Rule: For the last leg, there is no departure.

Rule: All legs except first and last have both an arrival and a departure.

2 questions:

How is best to express these rules?

How to do comparisons if the time were expressed in a manner not
easily compared as strings, e.g. "1/30/2006 08:00"?

Thanks.









Fri Sep 15, 2006 5:13 pm

johnbrockus
Offline Offline
Send Email Send Email

Forward
Message #39 of 74 |
Expand Messages Author Sort by Date

Imagine a truck delivery schedule. Suppose xml is: ... <schedule> <leg> <depart>08:00</depart> </leg> <leg> <arrive>08:45</arrive> <depart>10:00</depart> ...
johnbrockus
Offline Send Email
Sep 16, 2006
4:14 pm

... Your rule is correct except that, unfortunately, XPath does not do string comparison; it tries to convert the values to numbers first. But, there is a...
Waleed K. Abdulla
waleed_ka
Offline Send Email
Sep 16, 2006
5:34 pm

... XPath 1.0 is limited to this, XPath 2.0 supports the 19 primitive types defined by XML Schema. I believe the only XPath 2.0 implementation for .NET is...
David Carver
d_a_carver
Online Now Send Email
Sep 17, 2006
1:57 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help