<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.documentUri.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.documentUri</api:function-name><api:suggest>fn.documenturi</api:suggest><api:suggest>fn</api:suggest><api:suggest>documenturi</api:suggest><api:function-link mode="xquery" fullname="fn:document-uri">/apidoc/8.0/fn:document-uri.xml</api:function-link><api:function mode="javascript" name="documentUri" type="builtin" lib="fn" category="AccessorBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.documentUri"><api:summary>
 Returns the value of the document-uri property for the specified node.
 If the node is a document node, then the value returned is the URI of the
 document. If the node is not a document node, then
 <code xmlns="http://www.w3.org/1999/xhtml">fn:document-uri</code> returns the empty sequence.
</api:summary><api:params><api:param name="arg" type="node()?"><api:param-description>
  The node whose document-uri is to be returned.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>Node?</api:param-type></api:param></api:params><api:return>String?</api:return><api:usage>
  <code xmlns="http://www.w3.org/1999/xhtml">fn:document-uri</code> will only return the URI of a document
  when a document node is passed into it.  If you want to return the URI
  of a node that is not a document node, but has a document node ancestor,
  use <a href="./fn:base-uri" xmlns="http://www.w3.org/1999/xhtml"><code>fn:base-uri</code></a> or 
  <a href="./xdmp:node-uri" xmlns="http://www.w3.org/1999/xhtml"><code>xdmp:node-uri</code></a>.
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var x = cts.doc("/bar.json");
fn.documentUri(x);

=&gt; "/bar.json"
</pre></api:example></api:function></api:function-page>