<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.prefixFromQName.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.prefixFromQName</api:function-name><api:suggest>fn.prefixfromqname</api:suggest><api:suggest>fn</api:suggest><api:suggest>prefixfromqname</api:suggest><api:function-link mode="xquery" fullname="fn:prefix-from-QName">/apidoc/8.0/fn:prefix-from-QName.xml</api:function-link><api:function mode="javascript" name="prefixFromQName" type="builtin" lib="fn" category="QNameBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.prefixFromQName"><api:summary>
  Returns an <code xmlns="http://www.w3.org/1999/xhtml">xs:NCName</code> representing the prefix of $arg.
  The empty sequence is returned if $arg is the empty sequence or
  if the value of $arg contains no prefix.
</api:summary><api:params><api:param name="arg" type="xs:QName?"><api:param-description>
A qualified name.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>xs.QName?</api:param-type></api:param></api:params><api:return>xs.NCName?</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.prefixFromQName(
   fn.QName("http://www.example.com/example", "person") )

=&gt; empty sequence, because the QName constructed
   by fn.QName does not have a prefix
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var foo = xdmp.unquote('&lt;foo xml:lang="en"/&gt;');
var node = foo.toArray()[0].xpath("./foo/@xml:lang");
fn.prefixFromQName(fn.nodeName(node));

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