QT4CG-003-01: MK to find a way to specify fn:characters() more formally

I think there are two possibilities:

(a) string-to-codepoints($input) ! codepoints-to-string(.)

(b) if ($input) then (fn:substring($input, 1, 1), fn:characters(fn:substring($input, 2))) else ()

I've chosen (a), on the basis that string-to-codepoints() and codepoints-to-string() are probably fundamental to the definition of a string as a sequence of code points, whereas fn:substring(), if we chose, could be expressed in terms of fn:characters() and fn:subsequence().

Michael Kay

Received on Tuesday, 20 September 2022 18:36:58 UTC