<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.referenceParse.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.referenceParse</api:function-name><api:suggest>cts.referenceparse</api:suggest><api:suggest>cts</api:suggest><api:suggest>referenceparse</api:suggest><api:function-link mode="xquery" fullname="cts:reference-parse">/apidoc/8.0/cts:reference-parse.xml</api:function-link><api:function mode="javascript" name="referenceParse" type="builtin" lib="cts" category="SearchBuiltins" subcategory="Lexicon" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.referenceParse"><api:summary>
  Creates a reference to a value lexicon by parsing its XML or JSON
  representation, for use as a parameter to cts:value-tuples.  Since
  lexicons are implemented with range indexes, this function will
  throw an exception if the specified range index does not exist.
</api:summary><api:params><api:param name="reference" type="node()"><api:param-description>
    A reference to a range index.</api:param-description><api:param-name>reference</api:param-name><api:param-type>Node</api:param-type></api:param></api:params><api:return>cts.reference</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
cts.referenceParse(xdmp.unquote(
'  &lt;cts:element-reference xmlns:cts="http://marklogic.com/cts"&gt;'
+'    &lt;cts:namespace-uri&gt;http://example.com/namespace&lt;/cts:namespace-uri&gt;'
+'    &lt;cts:localname&gt;title&lt;/cts:localname&gt;'
+' &lt;/cts:element-reference&gt;').next().value.root
)
=&gt;
cts.elementReference(
  fn.QName("http://example.com/namespace","title"),["type=unknown"])

</pre></api:example></api:function></api:function-page>