<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.inScopePrefixes.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.inScopePrefixes</api:function-name><api:suggest>fn.inscopeprefixes</api:suggest><api:suggest>fn</api:suggest><api:suggest>inscopeprefixes</api:suggest><api:function-link mode="xquery" fullname="fn:in-scope-prefixes">/apidoc/8.0/fn:in-scope-prefixes.xml</api:function-link><api:function mode="javascript" name="inScopePrefixes" type="builtin" lib="fn" category="QNameBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.inScopePrefixes"><api:summary>
<p xmlns="http://www.w3.org/1999/xhtml">
Returns the prefixes of the in-scope namespaces for $element. For namespaces
that have a prefix, it returns the prefix as an xs:NCName. For the default
namespace, which has no prefix, it returns the zero-length string. 
</p>
</api:summary><api:params><api:param name="element" type="element()"><api:param-description>
The element whose in-scope prefixes will be returned.
  </api:param-description><api:param-name>element</api:param-name><api:param-type>Node</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var x = xdmp.unquote('&lt;a:hello xmlns:a="a"&gt;hello'
         +   '&lt;b:goodbye xmlns:b="b"&gt;goodbye&lt;/b:goodbye&gt;'
	 + '&lt;/a:hello&gt;');
fn.inScopePrefixes(x.toArray()[0].xpath("/element()"));

=&gt; ("a", "xml")

var x = xdmp.unquote('&lt;a:hello xmlns:a="a"&gt;hello'
         +   '&lt;b:goodbye xmlns:b="b"&gt;goodbye&lt;/b:goodbye&gt;'
	 + '&lt;/a:hello&gt;');
fn.inScopePrefixes(x.toArray()[0].xpath("/element()/element()"));

=&gt; ("b", "a", "xml")
</pre></api:example></api:function></api:function-page>