Loading TOC...

MarkLogic Server 11.0 Product Documentation
cts.referenceParse

cts.referenceParse(
   reference as Node
) as cts.reference

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.

Parameters
reference A reference to a range index.

Example

cts.referenceParse(fn.head(xdmp.unquote(
   '<cts:element-reference xmlns:cts="http://marklogic.com/cts">'
  +'  <cts:namespace-uri>http://example.com/namespace</cts:namespace-uri>'
  +'  <cts:localname>title</cts:localname>'
  +'</cts:element-reference>')).root
)
=>
cts.elementReference(
  fn.QName("http://example.com/namespace","title"),["type=unknown"])

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.