tf:createNearTextReference

Create reference descriptions for nearby text locations.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

tf:createNearTextReference(node $input, integer $distance, token+ $word) => node*

Description

The function tf:createNearTextReference is specific to Tamino. It takes a node sequence, an integer value indicating a distance, and one or more word tokens as arguments. Similar to the function tf:containsNearText it searches all word tokens of the node that are within the specified distance regardless of the token order. However, it does not return a Boolean value, but a sequence of reference descriptions for all nodes found.

You can use reference descriptions for subsequent highlighting of these nodes, see tf:highlight.

With tf:createNearTextReference you can create reference descriptions based on a search using wildcard characters. The section Pattern Matching in the XQuery 4 User Guide explains this in detail.

Arguments

$input

node

$distance

integer value denoting proximity distance

$word

a word token

Example

  • Create reference descriptions in remarks nodes stating that patients respond to treatment:

    for $a in input()/patient
    return tf:createNearTextReference($a/remarks, 2, "treatment", "responding")

    This query returns reference descriptions to the locations of all word tokens found.

    graphics/xqr-refdesc-near.png