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...
Message search is now enhanced, find messages faster. Take it for a spin.

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 #41 of 74 |
Re: [xrules] How to do sibling checks? non-string compares?

Waleed K. Abdulla wrote:
>
> > How to do comparisons if the time were expressed in a manner not
> > easily compared as strings, e.g. "1/30/2006 08:00"?
>
> Not easy. XPath doesn’t recognize a date/time type. I’d recommend
> using the standard XML format for dates: 2006-01-30T08:00. This is the
> ‘standard’ way for dates in XML, and with it you can use the
> translate() trick to remove the -, T, and : and perform date comparisons.
>
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 Saxon .NET. Might be worth checking out. Here is more info on
Xpath 2.0.

http://www.xml.com/pub/a/2002/03/20/xpath2.html

Dave




Sun Sep 17, 2006 1:45 am

d_a_carver
Offline Offline
Send Email Send Email

Forward
Message #41 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
Offline Send Email
Sep 17, 2006
1:57 am
Advanced

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