Problems found with XQuery 1.0 and XPath 2.0 Functions and Operators - 
working draft 16 August 2002
#########################################################################

## Taken out of Nov. 02 spec
6.3.5 Substring is undefined for startingLoc = 0 (it is defined for < 0 and >= 1) 

#fixed
8.4.9.1 Example for get-day-from-dateTime has function name 'get-year'-from-dateTime instead of 'get-day'

#fixed
8.5.8 divide-dayTimeduration reads 'round to the nearest month' where it should be 'round to the nearest second'

8.5.8.1 Example for divide-dayTimeDuration has parameter type yearMonthDuration where should be type dayTimeDuration

#fixed
8.7.3.1 "1999-11-28 missing closing quote


8.6.3.1 add-timezone-to-date "2002-03-07 missing closing quote

#fixed
8.7.11 Example for subtract-yearMonthDuration-from-date has parameter type dateTime where is should be type date

#fixed
// Mailed newsgroup regarding
8.7.8.1 Example has incorrect result.  The resulting dateTime from dateTime(2000-10-30T11:12:00) - dayTimeDuration(P3DT1H15M) should be '2000-10-27T09:57:00

9.1 "Leading and trailing whitespace is stripped if present": the XML Schema
data types spec says that all atomic datatypes other than string and its
descendants collapse whitespace, ie tabs and newlines are replaced with spaces,
leading and trailing whitespace is stripped, and multiple consecutive spaces
are collapsed into a single space. This applies to anyURI. The "name"
production of the XML 1.0 spec (which applies to the local part of a QName)
excludes spaces. The quoted section of F&O should read "whitespace in $paramURI
is normalised as described under xf:normalize-space, and whitespace in
$paramlocal is stripped entirely".

13.1.7 xf:deep-equal concatenates text nodes if the arguments have simple
content, but considers child nodes pairwise if the arguments have non-simple
content, so
<foo>Some text</foo> and <foo>Some <!--commented-->text</foo>
return deep-equal, but
<foo>Some text<bar/></foo> and <foo>Some <!--commented-->text<bar/></foo>
do not.

14.2.4 xf:index-of() ignores everything but string-value for nodes, so
<foo>Text</foo> will match <bar>Text</bar>, or even <bar><baz>Text</baz></bar>.

Inconsistent error messages: 

#fixed
14.4.2 avg has error message "Argument not numeric" while 14.4.5 sum has error message "Non-numeric values".  The error messages are for the exact same thing.

14.2.11 subsequence does not specify behaviour for certain cases. For now am taking the behaviour of substring for the following:
- how to deal with the decimal values of startingLoc and length (with round)
- startingLoc < 0 or startingLoc > length (error: Invalid subsequence starting argument)
- startingLoc = 0 (this is also undefined in substring, but am being consistant with the substring method whereby an exception is raised) 

8.3.8 dateTimeEqual - This example shows an invalid representation of dateTime per the 'XML Schema Part 2: Datatypes - dateTime' definition.  Seconds are missing. 

#fixed
8.4.1 - 8.4.6 The examples for these have parameter type 'xs:duration' when it should be of type 'yearMonthDuration' or 'dayTimeDuration'

#fixed
8.4.6 - get-seconds-from-dayTimeDuration => integer?
        This should not be integer it should be decimal.  The given example shows the returned value as a decimal.

8.5.2 - subtract-yearMonthDurations has small typo 'subtracting the value of $srcval2 from the value of $srcval2' (instead of 'from the value of $srcval1')

#fixed
// Mailed newsgroup regarding
8.5.7.1 - multiply-dayTimeDuration example:
Example has wrong result. 
2H10M = 7800S
7800S * 2.1 = 16380S
16380S = 4H 33 M (not 4H 23M)

#fixed
// Mailed newsgroup regarding
8.5.8.1 - divide-dayTimeDuration example:
Example has wrong result.
1D2H30M10.5S = 95410.5S
95410.5 / 1.5 = 63607S
63607S = 17H 40M 7S (not 17H 40M 2S)

#fixed
// Mailed newsgroup regarding
8.7.14 - subtract-dayTimeDuration-from-time example has incorrect result:
time(11:12:00) - dayTimeDuration(P3DT1H15M) = 9:57:00 (not 10:57:00)

8.7.12 - subtract-dayTimeDuration-from-date example has incorrect result:
date(2000-10-30) - dayTimeDuration(P3DT1H15M) = October 27, 2000 (not October 28, 2000)

8.6.* Timezone function examples (dateTime and time) are missing seconds component

16.8 Casting to duration and date and time types
Part 6 -  If ST is dateTime or date, then let SMO be cast as string( xf:get-month( SV ) ) and let SDA be cast as string( xf:get-day( SV ) ); TV is xs:gYearMonth( xf:concat( SMO , '-', SDA ) ).
- the day part should be year

Nov 15/02 spec:
F&O 15.8 fn:implicit-timezone() states "Returns the implicit timezone from the static context", but in the XPath2 spec 2.1.2 states that the implicit timezone is in the evaluation context not the static one.

XPath2 Spec
###########

Lexical rules - 

No rule for actually matching integer literal, decimal or double
literal or QName!

No rule for ] - also rule for [ should really PUSH(INITIAL) (implied
rule for ] therefore POP()s)

Fallback conversions due to atomize during numeric operators - no
required type, therefore fallback conversion is not possible - formal
semantics provides atomize(no required type)

Appendix B2
###########

The parameters to operator `to' are both decimal - in the text they
are refered to as integer - decimal in spec
