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

EXPath binary module - suggestion - bin:insert-before()

From: John Lumley <john@saxonica.com>
Date: Mon, 05 Aug 2013 14:00:37 +0100
Message-ID: <51FFA1F5.307@saxonica.com>
To: EXPath ML <public-expath@w3.org>
Thinking about functions like bin:join() and (probably to be renamed) 
bin:subsequence(), it occurred to me that an equivalent of 
fn:insert-before() might be i) useful, ii) fast by comparison with 
break-and-join and iii) trivial to implement given the other implemented 
functions.

    bin:insert-before($in as xs:base64Binary, $offset as xs:integer,
    $new as xs;base64Binary) as xs:base64Binary

which inserts $new into the octet sequence at the $offset octet, 
shifting the remainder backwards. Whilst there isn't a string equivalent 
function, inserting into item()* sequences was considered important 
enough to warrant a specific function.

A minor point perhaps, but very easy to put in at this stage. Thoughts?
-- 
*John Lumley* MA PhD CEng FIEE
john@saxonica.com <mailto:john@saxonica.com>
on behalf of Saxonica Ltd
Received on Monday, 5 August 2013 13:00:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:52:20 UTC