The rules for op:hexBinary-less-than() appear to define a recursive octet-by-octet operation, but I think it flounders in rule 3, where it does not ask for rule 2 to be applied seriatim to each octet pair, but asks for an en masse comparison of two octet sequences.
Compare to 5.3.2, Unicode Codepoint Collation, which describes a similar recursive item-for-item comparison. Interesting formal differences (e.g., unordered list versus ordered list).
fn:deep-equal() is similar, but it is also much more complex. Nevertheless, the way it breaks down the problem at the outset, to dispense immediately with the recursive factor, and deal simply with the rules for equality, is IMO admirable.
It would be nice if there were a bit more consistency in the prose and presentation of recursive rules. Do others agree, and are there other functions/operations that should be considered in this question? I'm thinking immediately only of comparator functions/operations, not functions that use recursion to filter or create. (There may be parallels, but let's start with those functions that are most similar.)
By all means try to improve matters - it's not something I want to invest a great deal of time in. There's always a risk of introducing bugs unintentionally.
The rules for op:hexBinary-less-than() appear to define a recursive octet-by-octet operation, but I think it flounders in rule 3, where it does not ask for rule 2 to be applied seriatim to each octet pair, but asks for an en masse comparison of two octet sequences.
Compare to 5.3.2, Unicode Codepoint Collation, which describes a similar recursive item-for-item comparison. Interesting formal differences (e.g., unordered list versus ordered list).
fn:deep-equal() is similar, but it is also much more complex. Nevertheless, the way it breaks down the problem at the outset, to dispense immediately with the recursive factor, and deal simply with the rules for equality, is IMO admirable.
It would be nice if there were a bit more consistency in the prose and presentation of recursive rules. Do others agree, and are there other functions/operations that should be considered in this question? I'm thinking immediately only of comparator functions/operations, not functions that use recursion to filter or create. (There may be parallels, but let's start with those functions that are most similar.)