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

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

From: Michael Kay <mike@saxonica.com>
Date: Thu, 14 Mar 2013 09:55:26 +0000
Message-ID: <51419E8E.3050902@saxonica.com>
To: Jirka Kosek <jirka@kosek.cz>
CC: public-expath@w3.org

On 14/03/2013 09:26, Jirka Kosek wrote:
> 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?
I left that open for discussion deliberately. I see no reason not to 
generalize it to arbitrary length. For example, there are datasets in 
which searching for the next occurrence of x0D0A could be useful.

Michael Kay
Received on Thursday, 14 March 2013 09:55:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:47:36 UTC