<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.encodeForNCName.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.encodeForNCName</api:function-name><api:suggest>xdmp.encodeforncname</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>encodeforncname</api:suggest><api:function-link mode="xquery" fullname="xdmp:encode-for-NCName">/apidoc/8.0/xdmp:encode-for-NCName.xml</api:function-link><api:function mode="javascript" name="encodeForNCName" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.encodeForNCName"><api:summary>
   Invertible function that escapes characters required to be part of an NCName.
   This is useful when translating names from other representations such as
   JSON to XML.
   Given any string, the result is always a valid NCName.
   Providing all names are passed through this function the result is
   distinct NCNames so the results can be used for searching as well as
   name generation.
   The inverse function is 
   <a href="./xdmp:decode-for-NCName" xmlns="http://www.w3.org/1999/xhtml"><code>xdmp:decode-for-NCName</code></a>.
</api:summary><api:params><api:param name="name" type="xs:string"><api:param-description>
  A string which is used as an NCName (such as the localname for an
  element or attribute).
  </api:param-description><api:param-name>name</api:param-name><api:param-type>String</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">
xdmp.encodeForNCName("A name");
=&gt; "A_20_Name"
</pre>
</api:example></api:function></api:function-page>