| valign='top' | '''Examples'''
|The following query returns <code><XML><mark>hello</mark> world</XML></code>, if one text node of the database <code>DB</code> has the value "hello world":<br />
<code>ft:mark(db:open('DB')//*[text() contains text 'hello'])</code><br />The following expression returns <code><p><b>word</b></p></code>:<br /> <code>copy $p := <p>word</p></code><br /> <code>modify ()</code><br /> <code>return ft:mark($p[text() contains text 'word'], 'b')</code><br />
|-
| valign='top' | '''Errors'''
| valign='top' | '''Examples'''
|The following query may return <code><XML>...<b>hello</b>...<XML></code> if a text node of the database <code>DB</code> contains the string "hello world":<br />
<code>ft:extract(db:open('DB')//*[text() contains text 'hello'], 'b', 1)</code><br />
|-
| valign='top' | '''Errors'''