[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath string comparison of two strings representin

Subject: Re: XPath string comparison of two strings representing calendar dates ... any counterexamples?
From: "Wolfgang Laun wolfgang.laun@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Aug 2017 16:26:38 -0000
Re:  XPath string comparison of two strings representin
On 16 August 2017 at 18:09, Costello, Roger L. costello@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

>
> I wish to test to see if the calendar date represented in <Date2> is
> greater than (occurs later in chronological time) the calendar date
> represented in <Date1>. Here's an XPath expression to do the test:
>
> /Test/Date2 gt /Test/Date1
>
> In this case, the XPath returns true.
>
> Note that I am doing mere string comparison. I am comparing the string
> '20170817' against the string '20170816'.
>
> Will the XPath always work?
>
>
No. Once the year reaches 5 digits, 2017 will be greater and later than
10010 or so.

Well, you wrote "always"!

-W

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.