<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.subbinary.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.subbinary</api:function-name><api:suggest>xdmp.subbinary</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>subbinary</api:suggest><api:function-link mode="xquery" fullname="xdmp:subbinary">/apidoc/8.0/xdmp:subbinary.xml</api:function-link><api:function mode="javascript" name="subbinary" type="builtin" lib="xdmp" category="Extension" subcategory="MarkLogic Server" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.subbinary"><api:summary>
  Returns a binary node made up of a subset of the given binary node.
</api:summary><api:params><api:param name="source" type="binary()"><api:param-description>
    A binary node whose subset will be returned
  </api:param-description><api:param-name>source</api:param-name><api:param-type>binary()</api:param-type></api:param><api:param name="starting-location" type="xs:double" optional="false"><api:param-description>
    The new binary node starts at the byte position indicated by starting-location.
    The first byte is at location 1.
  </api:param-description><api:param-name>starting-location</api:param-name><api:param-type>Number</api:param-type></api:param><api:param name="length" type="xs:double" optional="true"><api:param-description>
    The length in bytes of the new binary node.
  </api:param-description><api:param-name>length</api:param-name><api:param-type>Number</api:param-type></api:param></api:params><api:return>binary()</api:return><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">Usage is exactly like fn:substring except that it applies to a binary
  node rather than a string.</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var node = new NodeBuilder();
var bin = node.addBinary( "DEADBEEF" ).toNode();
xdmp.describe(fn.data(xdmp.subbinary(bin, 3, 2)));
  =&gt; xs:hexBinary("BEEF")
</pre></api:example></api:function></api:function-page>