
spell:make-dictionary( $words as xs:string*, [$output-kind as xs:string] ) as item()
Creates a dictionary node from a sequence of words.
xquery version "1.0-ml";
import module namespace spell = "http://marklogic.com/xdmp/spell"
at "/MarkLogic/spell.xqy";
let $words := ("words", "to", "go", "in", "the", "dictionary")
return
spell:make-dictionary($words)
=>
<dictionary xmlns="http://marklogic.com/xdmp/spell">
<word>words</word>
<word>to</word>
<word>go</word>
<word>in</word>
<word>the</word>
<word>dictionary</word>
</dictionary>
xquery version "1.0-ml";
import module namespace spell = "http://marklogic.com/xdmp/spell"
at "/MarkLogic/spell.xqy";
spell:make-dictionary(cts:words())
=> A spell:dictionary element containing all the words in the database.
Use spell:insert to insert this into the database as a dictionary.
This example requires a word lexicon on the database. You can
construct the sequence of words any way you like.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.