Re: [Fwd: Binary proposal]

Jirka,

thanks a lot for your elaborate proposal! Some first comments:

- I would also plead for a switch to base64 as default format, as this
appears to be the predominant binary type in EXPath and other use
cases. I also assume that conversion between hex and base64 types
should be cheap in most implementations.

- Most EXPath specs and vendor-specific modules avoid redundancies in
the prefixes and the function names. This is why I would suggest to
remove the "binary-" string in some of the function names and instead
rename the prefix to "binary". The resulting names could be called
"binary:length", "binary:or", etc.

- As binary operators (and, or, not, xor) are pretty low-level,
wouldn’t it make sense to restrict them to single octets (i.e., items
of type xs:integer)? Otherwise, the operation $a ^ $b would need to be
written as bin:binary-to-octets(bin:binary-xor(bin:octets-to-binary($a),
bin:octets-to-binary($b)))). What about binary:xor($a, $b)? ;)

- In response to Adam’s concern on performance and memory limitations:
so-called streamable items are used in Zorba and BaseX [1]. The number
of 00-bytes in a byte stream can e.g. be summed up with the following
call, which uses constant memory:

  count( convert:binary-to-bytes( file:read-binary("file") )[. = 0])

Hope this helps, thanks again,
Christian

[1] http://docs.basex.org/wiki/Streaming_Module
___________________________

On Wed, Mar 13, 2013 at 9:39 AM, Jirka Kosek <jirka@kosek.cz> wrote:
> On 15.2.2013 18:02, Florent Georges wrote:
>> On 15 February 2013 17:46, Michael Kay wrote:
>>
>>> For those of you interested, the situation at the end of the XSL WG
>>> face-to-face is, if I'm interpreting the consensus correctly:
>>
>>   Yes, that's my recollection as well.  For those interested, the page
>> of the CG is http://w3.org/community/expath/, with a link to the
>> mailing list.  We expect to release a first working draft soon.
>
> Hi,
>
> with a great help from Florent I was able to publish very first draft of
> this binary specification at
>
> http://expath.org/spec/binary
>
> Comments welcomed at public-expath@w3.org
>
>                         Jirka
>
> --
> ------------------------------------------------------------------
>   Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
> ------------------------------------------------------------------
>        Professional XML consulting and training services
>   DocBook customization, custom XSLT/XSL-FO document processing
> ------------------------------------------------------------------
>  OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
> ------------------------------------------------------------------
>     Bringing you XML Prague conference    http://xmlprague.cz
> ------------------------------------------------------------------
>

Received on Wednesday, 13 March 2013 14:19:31 UTC