<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.namespaceUri.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.namespaceUri</api:function-name><api:suggest>fn.namespaceuri</api:suggest><api:suggest>fn</api:suggest><api:suggest>namespaceuri</api:suggest><api:function-link mode="xquery" fullname="fn:namespace-uri">/apidoc/8.0/fn:namespace-uri.xml</api:function-link><api:function mode="javascript" name="namespaceUri" type="builtin" lib="fn" category="NodeBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.namespaceUri"><api:summary>
<p xmlns="http://www.w3.org/1999/xhtml">Returns the namespace URI of the xs:QName of the node specified by $arg.
</p><p xmlns="http://www.w3.org/1999/xhtml">
If the argument is omitted, it defaults to the context node. If the context
item is undefined an error is raised: [err:XPDY0002]. If the context item is
not a node an error is raised: [err:XPTY0004]. 
</p><p xmlns="http://www.w3.org/1999/xhtml">
If $arg is the empty sequence, the xs:anyURI
corresponding to the zero-length string is returned.
</p><p xmlns="http://www.w3.org/1999/xhtml">
If $arg is neither an element nor an attribute node, or if it is an element or
attribute node whose expanded-QName (as determined by the dm:node-name
accessor in the Section 5.11 node-name Accessor[DM]) is in no namespace, then
the function returns the xs:anyURI corresponding to the zero-length string.
</p>
</api:summary><api:params><api:param name="arg" type="node()?" optional="true"><api:param-description>
The node whose namespace 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:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var x = xdmp.unquote('&lt;a:name xmlns:a="a"/&gt;')
   .toArray()[0].root.xpath("/element()");
fn.namespaceUri(x);

=&gt; a
</pre></api:example></api:function></api:function-page>