
cts:entity-walk( $node as node(), $expr as item()*, [$dict as cts:entity-dictionary] ) as empty-sequence()
Walk an XML document or element node, evaluating an
expression
against any matching entities. This functions is similar to
cts:entity-highlight
in how it processes matched entities, but it differs in what it returns.
The following variables are available for use
inline in the expr parameter. These variables make aspects
of the matched entity available to your inline code.
$cts:nodeastext()- The node containing the match.
$cts:textasxs:string- The matched text. In the case of overlapping matches, this value may not encompass the entirety of the entity match string. Rather, it contains only the non-overlapping part of the text, in order to prevent introduction of duplicate text in the final result.
$cts:entity-type- The type of the matched entity, as defined by the
typefield of the matching entity dictionary entry.$cts:entity-id- The ID of the matched entity, as defined by the
idfield of the matching entity dictionary entry.$cts:normalized-textasxs:string- The normalized entity text (only applicable to some languages).
$cts:startasxs:integer- The offset (in codepoints) of the start of
$cts:textin the matched text node.$cts:actionasxs:string- The action to take. Use
xdmp:seton this variable in your inline code to specify what should happen next. Usexdmp:setto set the value to one of the following:
- "continue"
- Walk the next match. If there are no more matches, return all evaluation results. This is the default action.
- "skip"
- Skip walking any more matches and return all evaluation results.
- "break"
- Stop walking matches and return all evaluation results.