bin:unpack-unsigned-integer

Returns an unsigned integer value represented by the $size octets starting from $offset in the input binary representation.

unpack-unsigned-integer($value as (xs:hexBinary | xs:base64Binary), $offset as xs:integer, $size as xs:integer, $order as enum('least-significant-first', 'little-endian', 'LE', 'most-significant-first', 'big-endian', 'BE')?:='most-significant-first') ➔ xs:integer

Arguments

 

$value

(xs:hexBinary | xs:base64Binary)

Input binary data

 

$offset

xs:integer

Offset in octets into the input data

 

$size

xs:integer

The number of octets to unpack

 

$order

enum('least-significant-first', 'little-endian', 'LE', 'most-significant-first', 'big-endian', 'BE')?

:= 'most-significant-first'

The order (most/least significant first) in which to pack or unpack octets

Result

xs:integer

Namespace

http://expath.org/ns/binary

Links to specifications

EXPath Binary Module 1.0

EXPath Binary Module 4.0

Saxon availability

Available in XPath 2.0 and later versions. Implemented since Saxon 9.6. Requires Saxon-PE or Saxon-EE. Available for all platforms.