<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.localName.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.localName</api:function-name><api:suggest>fn.localname</api:suggest><api:suggest>fn</api:suggest><api:suggest>localname</api:suggest><api:function-link mode="xquery" fullname="fn:local-name">/apidoc/8.0/fn:local-name.xml</api:function-link><api:function mode="javascript" name="localName" type="builtin" lib="fn" category="NodeBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.localName"><api:summary>
<p xmlns="http://www.w3.org/1999/xhtml">Returns the local part of the name of $arg as an xs:string that
will either be the zero-length string or will have the lexical form of
an xs:NCName.
</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 the argument is supplied and is the empty sequence, the function
returns the zero-length string.
</p><p xmlns="http://www.w3.org/1999/xhtml">
If the target node has no name (that is, if it is a document node, a
comment, a text node, or a namespace node having no name), the
function returns the zero-length string.
</p><p xmlns="http://www.w3.org/1999/xhtml">
Otherwise, the value returned will be the local part of the expanded-QName of
the target node (as determined by the dm:node-name accessor in Section 5.11
node-name Accessor[DM]. This will be an xs:string whose lexical form is an
xs:NCName.
</p>
</api:summary><api:params><api:param name="arg" type="node()?" optional="true"><api:param-description>
The node whose local name 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.localName(x);

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