Loading TOC...

MarkLogic 9 Product Documentation
thsr:insert

thsr:insert(
   $uri as xs:string,
   $thsr as element(thsr:thesaurus)
) as empty-sequence()

Summary

Load the entries in $thsr into the thesaurus 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 a thesaurus document.
thsr A thesaurus document.

Usage Notes

If $thsr contains XML that does not conform to the thesaurus schema, an error is raised.

Example

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

  thsr:insert("/myThsrDocs/roget.xml", 
               xdmp:document-get("c:\thesaurus\roget.xml")/thsr:thesaurus )
  

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