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

Re: limits of the generic


Re:  limits of the generic
Hi Jeff,

> Yes, the comparison of these durations is determinate. However, it
> is inconsistent with
>
>     2004-02-29 + P1Y1D > 2004-02-29 + P365D
>
> which is false according to the algorithm you described, (but would
> be true for any starting date which is not 02-29 in a leap year). In
> other words, I cannot deduce from x > y (P1Y1D > P365D) that a + x >
> a + y. I realize its a different > operator (for durations vs.
> dates), but if they are not defined consistently there is a problem.

Ah, I see what you mean. It's not just a problem with xs:durations,
though, rather a problem whenever there's "pinning" of the dates back
to valid values. For example, even if you're just looking at
xf:yearMonthDurations, you'd expect:

  (2002-08-31 + P1M) + P1M

to be equal to:

  2002-08-31 + (P1M + P1M)

but (according to the algorithm in the Datatypes Rec.):

  (2002-08-31 + P1M) + P1M  =>  2002-09-30 + P1M  =>  2002-10-30

whereas:

  2002-08-31 + (P1M + P1M)  =>  2002-08-31 + P2M  =>  2002-10-31

I don't know whether XQuery & XPath 2.0 are supposed to use the W3C
XML Schema algorithm or not. The F&O WD just says:

  op:add-yearMonthDuration-to-dateTime(dateTime $srcval1,
    yearMonthDuration $srcval2) => dateTime

  Returns the end of a time period by adding a yearMonthDuration
  ($srcval2) to the dateTime that starts the period ($srcval1). If the
  duration is negative, then the "end" of the period precedes the
  "start" of the period.

Well spotted. I'll raise it as an issue.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.