25.12.2013 Views

Tamino XQuery User Guide - Software AG Documentation

Tamino XQuery User Guide - Software AG Documentation

Tamino XQuery User Guide - Software AG Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Text Retrieval<br />

for $a in input()/reviews/entry<br />

return tf:createTextReference($a/review, "discussion")<br />

<strong>Tamino</strong> will return these two object descriptions in its response:<br />

The figure below shows you the text ranges for which reference descriptions have been created:<br />

Highlighting Documents<br />

Any location, for which a reference description exists, can be highlighted by using the function<br />

tf:highlight. The query performing the highlighting is repeated here for your convenience:<br />

for $a in input()/reviews/entry<br />

let $ref := tf:createTextReference($a/review, "discussion")<br />

where $ref<br />

return tf:highlight($a, $ref, "REV_DISC")<br />

As arguments, the function tf:highlight requires a node, a previously-generated reference description<br />

and a marker string. <strong>Tamino</strong> uses processing instructions (PIs) to indicate the start and<br />

end of the range to be highlighted so that a client application receiving the <strong>Tamino</strong> response document<br />

can parse and process them. The marker string is used as the so-called PI target. You can<br />

easily identify the highlighted text ranges in the response document for the above query:<br />

90<br />

<strong>XQuery</strong> <strong>User</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!