Loading TOC...

MarkLogic 12 EA 2 Product Documentation
spell:insert

spell:insert(
   $uri as xs:string,
   $dict as item()
) as empty-sequence()

Summary

Load the words in $dict into the dictionary at $uri. If there is no document at $uri a new one will be created. If there is a document at $uri it will be overwritten.

Parameters
uri The URI of the dictionary.
$dict A dictionary document which can be an xml element, a javascript object or a json object-node.

Example

  xquery version "1.0-ml";
  import module namespace spell = "http://marklogic.com/xdmp/spell" 
		  at "/MarkLogic/spell.xqy";

  spell:insert("/mySpell/special.xml", 
     <dictionary xmlns="http://marklogic.com/xdmp/spell">
          <word>WebDAV</word>
     </dictionary> )

  => Creates a dictionary with only the word "WebDAV" 
     at the specified URI
  

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