Changes

Jump to navigation Jump to search
6 bytes added ,  18:49, 11 May 2020
|-
| '''Summary'''
|Puts a marker element around the resulting {{Code|$nodes}} of a full-text index request.<br />The default name of the marker element is {{Code|mark}}. An alternative name can be chosen via the optional {{Code|$name}} argument.<br />Please note that:
* the full-text expression that computes the token positions must be specified as argument of the <code>ft:mark()</code> function, as all position information is lost in subsequent processing steps. You may need to specify more than one full-text expression if you want to use the function in a FLWOR expression, as shown in Example 2.
* the XML node to be transformed must be an internal "database" node“database node”. The {{Code|transform}} expression can be used to apply the method to a main-memory fragment, as shown in Example 3.
|-
| '''Examples'''
}
</syntaxhighlight>
'''Example 3''': The following expression returns <code>&lt;pxml>hello &lt;b&gt;word&lt;/b&gt;&lt;/pxml&gt;</code>:
<syntaxhighlight lang="xquery">
copy $p := <pxml>hello word</pxml>
modify ()
return ft:mark($p[text() contains text 'word'], 'b')
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu