|
From: Caesar, I. <ca...@rg...> - 2013-10-10 07:38:24
|
Dear list,
the threat/problem: in eXists 2.1 collection "doc" there is a function that passes a search result to "docbook.xql" and highlights the result(s) in the target document i.e.:
(:~
: Load a docbook document. If a query was specified, re-run the query on the document
: to get matches highlighted.
:)
declare
%public %templates:default("field", "all")
function docbook:load($node as node(), $model as map(*), $q as xs:string?, $doc as xs:string?, $field as xs:string) {
let $path := $config:data-root || "/" || $doc
return
if (exists($doc) and doc-available($path)) then
let $context := doc($path)
let $data :=
if ($q) then
dq:do-query($context, $q, $field)
else
$context
return
map { "doc" := util:expand($data/*, "add-exist-id=all") }
else
<p>Document not found: {$path}!</p>
}; (etc.)
My plan: doing a query, click on a result-entry, land at the target document where the result(s) are still highlighted (like in the doc collection). But instead of a display solution like dokbook.xql we want to use an xslt for displaying the target document but integrate the function above before or after the xslt is triggered. Is that possible? Are there approaches to do so?
Best regards and thanks in advance
Ingo
|