Hello, Section 9.7.2 (https://www.w3.org/TR/xpath-functions-3/#func-subtract-dateTimes) of the XPath and XQuery Functions and Operators 3.1 document defines the op:subtract-dateTimes function as follows: The function returns the elapsed time between the date/time instant arg2 and the date/time instant arg1, computed according to the algorithm given in Appendix E of [XML Schema Part 2: Datatypes Second Edition], and expressed as a xs:dayTimeDuration. Unfortunately, the XML Schema Datatypes specification does not seem to contain such an algorithm: both https://www.w3.org/TR/xmlschema-2/ and https://www.w3.org/TR/xmlschema11-2/ contain only an algorithm for adding xs:duration to an xs:dateTime, but neither of them contains an algorithm for subtracting xs:dateTime objects. In fact, the latter document says the following: duration can provide addition and subtraction operations between duration values and between duration/dateTime value pairs, and can be the result of subtracting dateTime values. Hence, this seems to me like an omission in the standard. I thought a bit about this issue and came to the conclusion that the resolution is nontrivial as there seem to be at least two possible ways of computing the difference. 1. Two xs:dateTime objects represent fixed points in time, so one can compute the elapsed number of seconds between them. Thus, the difference could be represented as an xs:duration object whose month component is zero and the second component is the time difference. 2. One could compute both the number of elapsed months and the number of elapsed seconds and construct an xs:duration object in that way. The second solution seems applicable to date/time datatypes other than xs:dateTime (such as xs:time or xs:gMonthYear), whereas the first solution seems applicable only to xs:dateTime and xs:dateTimeStamp datatypes. In any case, clarification on this point would be useful. Regards, Boris Motik
Hi XQuery working group, I know that the working group is dormant (or whatever the official term is) right now, but I've just stumbled across an issue, which may not be an problem with the XQuery recommendation itself but with downstream communication with another standards body: The XQuery 3.1 recommendation [1] states > This Appendix specifies the media type for XQuery Version 1.0. [...] This media type is being submitted to the IESG (Internet Engineering Steering Group) for review, approval, and registration with IANA (Internet Assigned Numbers Authority.) Alas, the application/xquery media type is *not* listed by IANA in its listed of media type assignments [2]. Did the registration get lost or was it rejected? I can't really think of a good reason for the latter, so I assume it must be the former. So maybe even a dormant working group can fix this oversight. Best wishes, Andreas Sewe [1] <https://www.w3.org/TR/2017/REC-xquery-31-20170321/> [2] <https://www.iana.org/assignments/media-types/media-types.xhtml#application>