Changes

Jump to navigation Jump to search
37 bytes added ,  12:33, 2 July 2020
m
Text replacement - "[http://www.w3.org/TR/xpath" to "[https://www.w3.org/TR/xpath"
This [[Module Library|XQuery Module]] extends the [httphttps://www.w3.org/TR/xpath-full-text-10 W3C Full Text Recommendation] with some useful functions: The index can be directly accessed, fulltext results can be marked with additional elements, or the relevant parts can be extracted. Moreover, the score value, which is generated by the {{Code|contains text}} expression, can be explicitly requested from items.
=Conventions=
|-
| '''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 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 The supplied node to be transformed must be an internal "database" nodea [[Database Module#Database Node|Database Node]]. The As shown in Example 3, {{Code|update}} or {{Code|transform}} expression can be used to apply the method utilized to convert a main-memory fragment, as shown in Example 3to the required internal representation.
|-
| '''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 wordworld</pxml>
modify ()
return ft:mark($p[text() contains text 'word'], 'b')
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu