Representation of xs:base64Binary and xs:hexBinary
Binary values are represented internally as character strings using codepoints 0-255 to represent octet values. This is inefficient (a character occupies two octets); these days the obvious representation is Uint8Array.
Updated by Michael Kay over 3 years ago
Implementing this revealed a problem with collation keys; I strongly suspect the existing implementation isn't fully conformant, at least in ensuring that the ordering of collation keys corresponds to the ordering of the corresponding strings. (The spec is pretty confused about whether collation keys allow ordering, but I think the intended behaviour is that they do).
Internally, our collation objects have a collationKey() function that returns a string, but fn:collation-key() returns an xs:base64Binary value. I think that we're just using the 16-bit codepoints of the string as "octets" in the internal representation of the base64Binary value, which means that converting the collation key to a string is likely to crash the base64 encoding logic.
Please register to edit this issue