Loading TOC...


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


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

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.


  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.