EXPath binary module - comments

Some very minor comments on the new draft at http://expath.org/spec/binary (31 July 2013)

1. bin:hex()

I think it's intended that the input can consist of an odd number of hex digits, but there are a couple of statements that might suggest otherwise:

(a) the term "pairwise" in the summary

(b) the reference to the cast xs:hexBinary(string) (which requires an even number of digits IIRC).

So perhaps it should be stated categorically.

2. Negative zero

I think section 8.3 gets this wrong. XDM 3.0 section 2.7.7 says:

<quote>
The xs:float and xs:double data types in the data model have the same value space as in XML Schema 1.1 ([Schema 1.1 Part 2]). Specifically they include both negative and positive zero, and in this respect they differ from XML Schema 1.0.

To accommodate this difference, when converting from an xs:string to an xs:float or xs:double, it is implementation-defined whether the lexical value “-0” (and similar forms such as “-0.0”) convert to negative zero or to positive zero in the value space.

</quote>

So for XPath 3.0, since the data model must include a negative zero, it's reasonable that the corresponding IEEE value should produce a negative zero.

For XPath 2.0, the specs are less definitive; XDM says nothing, but F+O says (admittedly in a Note): "This specification uses [IEEE 754-1985] arithmetic for xs:float and xs:double values. This differs from [XML Schema Part 2: Datatypes Second Edition] " which carries a strong implication that there are functions and operators for which a return value of negative zero is required.


3. References

The reference to F+O 1.1 should be to 3.0.

Michael Kay
Saxonica

Received on Friday, 2 August 2013 17:01:29 UTC