Loading TOC...

MarkLogic Server 11.0 Product Documentation
xdmp:subbinary

xdmp:subbinary(
   $source as binary(),
   $starting-location as xs:double,
   [$length as xs:double]
) as binary()

Summary

Returns a binary node made up of a subset of the given binary node.

Parameters
source A binary node whose subset will be returned
starting-location The new binary node starts at the byte position indicated by starting-location. The first byte is at location 1.
length The length in bytes of the new binary node.

Usage Notes

Usage is exactly like fn:substring except that it applies to a binary node rather than a string.

Example

  data(xdmp:subbinary(binary { xs:hexBinary("DEADBEEF") }, 3, 2))
  => xs:hexBinary("BEEF")

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.