W3C home > Mailing lists > Public > public-expath@w3.org > March 2013

Finding binary data (Was: Re: Comments on binary specification)

From: Jirka Kosek <jirka@kosek.cz>
Date: Thu, 14 Mar 2013 10:26:06 +0100
Message-ID: <514197AE.4000901@kosek.cz>
To: Michael Kay <mike@saxonica.com>
CC: public-expath@w3.org
On 13.3.2013 11:01, Michael Kay wrote:
> 6.2 bin:unpack-string. This function is largely the composition of
> binary-subsequence and decode-string, which makes it largely a
> convenience function. The exception is that it can extract a subsequence
> based on the presence of a terminator; which suggests the need for a
> primitive such as bin:terminated-subsequence($in, $offset, $terminator),
> or perhaps more primitive still bin:find($in, $offset, $search) which
> returns the (relative?) offset of the first occurrence of $search after
> the specified $offset.

I like idea of bin:find(). Do you expect $search be just single octet or
arbitrary long binary data?

> With the function as specified, you can get a zero-terminated string,
> but it's hard to tell how many bytes you have read, which makes it
> difficult to move the read position forward to get the next string after
> the terminator.

That's true.

-- 
------------------------------------------------------------------
  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 Thursday, 14 March 2013 09:26:37 GMT

This archive was generated by hypermail 2.3.1 : Thursday, 14 March 2013 09:26:37 GMT