Re: New draft of EXPath binary module

>   I meant a user function (like a library to handle, say, images),
> which would like to return a sequence of binary items.  For instance:
>
>     (: split an image in 2 new images, horizontally :)
>     img:split-horizontally($img as xs:base64Binary) as xs:base64Binary+

Thanks, I got it. But I assume that bin:to-octets() and
bin:from-octets() could be used in the used-defined function before
and after the binary functions themselves are called.. As shown in the
following example:

  img:split-horizontally($img as xs:base64Binary) as xs:base64Binary+ {
    bin:from-octets( bin:not( bin:to-octets( $img )))
  }

It may not be as compact as the current solution, but my assumption is
that there are much more use cases on single or a few octets than on
arrays. Talking about requirements .. Have you already thought about
scenarios in which complete byte arrays may need to be processed via
binary operators?

Christian

Received on Saturday, 3 August 2013 15:20:59 UTC